February 23, 2012 at 1:48 am
Hi i have a query,
i want to pass comma separated names to stored procedure
where in stored procedure the name should be separated (which could be done by Function),then check table to get Id of that particular name in TableB and then insert it into tableC all to be done in single stored procedure as this is just one part of stored procedure.
how should be go about it
February 23, 2012 at 1:59 am
if ur using sql server 2008 , you should try using table data type , in which you can now pass a array as the input to the proc and then have it join with other tables internally.
If you do not have sql 2008 , use a recursive cte to split the string the the beginging of the proc .
February 23, 2012 at 3:02 am
is it possible to use table variable as a
input parameter for another query
February 24, 2012 at 12:08 am
I am not sure if your confusing a user defined table data type with a table variable . They are two different things.
A table variable can be reused within the same batch so you can use it as the "input" for another query, but not as a input to a procedure. If you want to pass a array as input to a proc then use a TABLE Data type
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply