Multiple values in stored proc parameter
-
Hi Guys, I need a hand with the following. I need to write a stored proc that accepts a parameter that contain multiple values. i.e alter proc spGetLastNames @Firstnames varchar(200) as Select lastname from user where firstname in(@Names) @Firstnames should be able to accept a comma delimited string i.e 'Frank', 'Peter', 'William' I am pondering whether to use XML to pass the Parameters, do you think this would be viable?
Kind Regards, Gary
My Website || My Blog || My Articles
-
Hi Guys, I need a hand with the following. I need to write a stored proc that accepts a parameter that contain multiple values. i.e alter proc spGetLastNames @Firstnames varchar(200) as Select lastname from user where firstname in(@Names) @Firstnames should be able to accept a comma delimited string i.e 'Frank', 'Peter', 'William' I am pondering whether to use XML to pass the Parameters, do you think this would be viable?
Kind Regards, Gary
My Website || My Blog || My Articles
See my article on parameterizing IN http://www.codeproject.com/cs/database/TableValuedFnsAsArrays.asp[^]
-
See my article on parameterizing IN http://www.codeproject.com/cs/database/TableValuedFnsAsArrays.asp[^]