Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing an array of integers to a sp
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00691118
Message ID:
00691206
Vues:
20
I know its not very good programming practice, but I have passed comma delimited strings into sp's and concatanating it into a sql string and then executing it in the sp to achive this functionality. I wouldnt suggest doing this unless you need a quick fix. Reason being, (i think) is that the server cant store an execution plan for a dynamicaly created sql statement.

>i would like to pass an array of integers to a stored procedure from an asp.net application to use like:
>strsql = "SELECT * FROM table WHERE ID IN (@array)"
>can this be done? if so, how do i do this? i can send a string to the stored procedure but it doesnt return any results because the it is expecting to match on an int.
>thanks in advance,
>tim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform