Home Forums SQL Server 2008 SQL Server Newbies how to store multiple rows in a stored procedure's parameters and then insert them in a table RE: how to store multiple rows in a stored procedure's parameters and then insert them in a table

  • aeri_q (10/17/2013)


    I have a query which gets multiple rows in result .

    i want to convert it in a stored procedure so the values of each column get stored in a parameter and then insert those values in a table.

    Any ideas to achieve this .

    I have written the stored procedure but it picks up only one row from the result set of query and fills the parameter s with values and inserts them in the table... but it reads only one row, the first one.

    How can i get able to read all the rows and insert them in table , with the help of some loop or whatever ... plzz help ..

    You are not being that clear here.

    Are you trying to pass a table to a Stored Procedure and then insert it's contents into a table within the Stored Procedure?

    If that is the case you can use Table Valued Parameters.