How do I pass a string parameter to a Stored Procedure with an 'in' clause?
ex.
Select * FROM Persons
WHERE PersonID IN (1,2,3,4,5,20,56,80)
How do I define my Store Procedure so I can pass the values between () as a string (nvarchar) parameter to the SqlCommand?
Thanks,
WYou would have to use dynamic SQL (create a string witht he values to create a SQL command) or pass in a delimited string, and then create a function to split the values and return a table, and use that returned table object in the IN clause.