mut*_*y91 0 sql-server stored-procedures
我正在从另一个内部调用一个存储过程。我在 SP1 中指定了一些返回值(整数)。我想从 SP2 中调用 SP1 并能够捕获这些返回值(并根据它们执行操作)。我怎样才能做到这一点?
CREATE PROCEDURE UPS_2
@Var1 Datatype, --<-- Variables you need to execute SP1
@Var2 Datatype,
@Var3 Datatype --<-- Also Variables you need to execute this proc
AS
BEGIN
SET NOCOUNT ON;
DECLARE @Rtn_Var Datatype;
EXECUTE @Rtn_Var = dbo.SP1 @Var1
/* Now you can use returned Values from SP1 Inside this proc */
/* Do other cool stuff here */
END
Run Code Online (Sandbox Code Playgroud)