February 17, 2010 at 7:05 am
I have poked around this site looking for an answer to the question below. Hopefully I didn't miss a post that had already answered the question.
Question
I have been reading about the new features of SQL Server 2008. One of the articles that I read mentioned Table Valued Parameters. I am a C# programmer. I was wondering if there was a way that I could pass an IEnumerable Collection to a stored procedure as a Table Valued Parameter? For example, how would I pass a List of Customers to a Stored Procedure? Is this possible?
Thanks
February 17, 2010 at 10:51 am
The article listed below may address your question:
http://www.sqlteam.com/article/sql-server-2008-table-valued-parameters
If not let me know, thanks.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 18, 2010 at 7:38 am
Welsh Corgi (2/17/2010)
The article listed below may address your question:http://www.sqlteam.com/article/sql-server-2008-table-valued-parameters
If not let me know, thanks.
The article goes half way there. What I mean by this is that it seems that from reading the article that I would have to load the data from my .NET collection into a datatable before calling the stored procedure. I was hoping to be able to pass the collection to the stored procedure without converting it to a data table. I will of course if I have too.
Thanks for posting the link to the article.
February 18, 2010 at 7:49 am
Some of the code here may help:
http://www.sqlservercentral.com/articles/SQL+Server+2008/66554/
February 18, 2010 at 8:55 am
Ken McKelvey (2/18/2010)
Some of the code here may help:http://www.sqlservercentral.com/articles/SQL+Server+2008/66554/
The section listed under the NOTES makes mention of what I need.
Thanks
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply