我正在从另一个内部调用一个存储过程。我在SP1中指定了一些返回值(整数)。我想从SP2中调用SP1并能够捕获这些返回值(并根据它们的内容执行操作)。我怎么能这样做?
答案 0 :(得分:4)
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