Array transmitting between layers.
What are the best ways to send arrays from js (jQuery) to sql sproc?
Could you share your ideas?
This generalizes my previous questions:
-
Js to MVC controller.
-
Best way to send arrays from MVC to SQL. (Is still open for discussion)
-
And this interesting SQL post for testing. What about [Table Valued Parameters]?
http://www.adathedev.co.uk/2010/02/sql-server-2008-table-valued-parameters.html
I think that best way is to send array as Table-Valued Parameter
How to pass an array to SP from MVC (any c# code). In your case it is a
int[]array, right?You also have to implement User Defined Table Type
Create procedure which accepts this parameter:
and finally call the proc with approptiate parameter: