T-Sql How to return a table from a storedproc in another stored proc

后端 未结 3 598
被撕碎了的回忆
被撕碎了的回忆 2021-02-05 13:37

I would like to do the following. Basically have a stored procedure call another stored procedure that returns a table. How is this done?

    ALTER PROC [GE         


        
3条回答
  •  不知归路
    2021-02-05 14:21

    The temporary-table approach, at least as expressed above, didn't work for me. You can use a variable, just as easily.

    DECLARE @return_value INT
    DECLARE @tblOutputTable TABLE(Col1 BIT NOT NULL, Col2 INT NOT NULL)
    
    INSERT INTO @tblOutputTable EXEC @return_value = [dbo].[SomeSp] @Param1 = 15, @Param2 = 2
    

提交回复
热议问题