Executing a stored procedure within a stored procedure

后端 未结 4 958
孤城傲影
孤城傲影 2020-12-15 15:22

I would like to execute a stored procedure within a stored procedure, e.g.

EXEC SP1

BEGIN

EXEC SP2
END

But I only want SP1

4条回答
  •  忘掉有多难
    2020-12-15 15:57

    T-SQL is not asynchronous, so you really have no choice but to wait until SP2 ends. Luckily, that's what you want.

    CREATE PROCEDURE SP1 AS
       EXEC SP2
       PRINT 'Done'
    

提交回复
热议问题