Click here to Skip to main content
15,885,760 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Dear sir,

I wonted to know how to pass array as a parameter to stored procedure in MS-SQL SERVER 2008.
Posted

Hi Pankaj this link may help you
http://support.microsoft.com/kb/555266[^]
 
Share this answer
 
You can make a string of comma separated values and pass it to the procedure as VARCHAR(MAX) then you can split it with a function which can be copied from here :
http://blog.codelab.co.nz/2009/07/29/split-function-for-t-sql-using-xml/[^]
or here :
http://blogs.microsoft.co.il/blogs/itai/archive/2009/02/01/t-sql-split-function.aspx[^]

And also there are table valued parameters.

For more info read articles on this page :
http://www.sommarskog.se/arrays-in-sql.html[^]

Hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900