Calling a Stored Proc from within a Stored Proc and returning a recordset

后端 未结 4 1468
情话喂你
情话喂你 2021-01-22 21:31

I have a Stored Procedure that rolls-back a series of operations. I want to call this from within another SP.

The problem is that the inner SP returns a record set with

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-22 22:25

    Here's a variation which will work well if you need to use this for MULTIPLE recordsets.

    CREATE TABLE #outsidetable (...)
    exec spInsideProcedure
    SELECT * FROM #outsidetable
    

    inside spInsideProcedure

    INSERT INTO #outsidetable SELECT 
    

提交回复
热议问题