What is the best, most preferable (and, if possible, efficient) way to pass an array of strings from a .NET application to a SQL Server 2005 stored procedure?
1) Pass the array of strings as a comma- or semicolon-delimited string and parse it into a temporary table?
2) Pass the array as XML and use SQL Server 2005 methods to parse it into a temporary table?
3) Write an ancilliary stored procedure to deal with each string individually and having .NET calling it for every element in the array?
4) Other… What?
I would say solution 2) is the most elegant one, but it is certainly not the most efficient… Is it?
Read this article.
Arrays and Lists in SQL Server 2005
The other related articles:
Arrays and Lists in SQL Server
Edit:
Sorry I did not realized that it is already mentioned in comments.