Can you show an example for passin table based value from c# code, i meen, what the type of System.Data.SqlTypes i need to set for the parameter in this case...
thanks in advance
Koby
Discussion on:
View:
Show:
Normally I'd say you owed me thumb, but I just learnt somthing by trying to answer your question.
Here you go
http://lennilobel.wordpress.com/2009/07/29/sql-server-2008-table-valued-parameters-and-c-custom-iterators-a-match-made-in-heaven/
Here you go
http://lennilobel.wordpress.com/2009/07/29/sql-server-2008-table-valued-parameters-and-c-custom-iterators-a-match-made-in-heaven/
How do you programatically call this SP from say C# and pass this table as input or how do you construct this table in the code to pass it as a parameter. It would be interesting to see the parameter binding as well. thanks.
I know that this thread is already pretty old, but here is an example that I found of calling a stored procedure with a table type as a variable:
http://www.sqlteam.com/article/sql-server-2008-table-valued-parameters
Hopefully, this will help someone in the future.
Thanks,
Chris
http://www.sqlteam.com/article/sql-server-2008-table-valued-parameters
Hopefully, this will help someone in the future.
Thanks,
Chris
I did this a while ago and it's running in several production stored procedures.
Essentially you need to form a dynamic SQL statement by stitching together strings and then execute it. See here for the full post - http://www.geakeit.co.uk/2011/02/05/a-table-input-variable-in-a-stored-procedure-and-bypassing-must-declare-the-table-variable-msg-1087/
Essentially you need to form a dynamic SQL statement by stitching together strings and then execute it. See here for the full post - http://www.geakeit.co.uk/2011/02/05/a-table-input-variable-in-a-stored-procedure-and-bypassing-must-declare-the-table-variable-msg-1087/
- Keyboard Shortcuts:
- Prev
- Next
- Toggle

































