How to get resultset of a stored proc into another stored proc

  • Hi,

    I need to get the resultset of a stored procedure which returns resultset in the form of XML into another stored procedure.

    Is there anyway ?

    I try like this

    Declare @var varchar(2000)

    @var = exec Link_Get '100'//Call sp and get the resultant xml

    Insert into LinkHistory(

    Details) values (@var)

    Thanks

    Mohit

  • Declare @var varchar(2000)

    exec Link_Get '100',@var out

    //Call sp and get the resultant xml

    Insert into LinkHistory( Details) values (@var)

    How abt this?

     

  • What would the script look like if the results of the stored procedure is multiple columns, like a table?


    cwiney

  • It's not working as the resultset is not output type parameter.

    When i call, it says

    Server: Msg 8144, Level 16, State 2, Procedure Link_Get, Line 0

    Procedure or function Link_Get has too many arguments specified.

     

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply