Sunday, February 19, 2012

array

how can i send array from asp.net to sql?

Give a look to this writeup by MVP Erland Sommarskog:

http://www.sommarskog.se/arrays-in-sql.html

SQL Server has no bulit in "ARRAY" data type. I would suggest passing the information as XML.

|||

In addition to Kent's excellent suggestion about using XML, you could pass a comma delimited string, and the parse that string into a table variable, and subsequently JOIN that table variable with other data.

See these sources for additional information:

Split Function (Jens Suessmeyer)
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=419984&SiteID=17
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=326300&SiteID=1

No comments:

Post a Comment