Question : How to send an array of values to stored procedure in SQL Server2000.

I am sending an array of values to stored procedure created in SQL Server2000. How can i send and accept those array of values in stored procedure. For Ex I am sending an array of employee numbers to a stored procedure and i want the stored procedure to return only those employee details which are in table. Could any body help me in this problem. Thanks -Ravi

Answer : How to send an array of values to stored procedure in SQL Server2000.

Instead of sending it as array, send them as comma separated values and in the sp in your query you can do something like this:

exec('
select * from empltable where emplid in ('+replace(@csvofempid, ',',''',''')+')
')

Random Solutions  
 
programming4us programming4us