回答

0

您必須聲明存儲過程定義中的所有參數以及存儲過程的實際調用或執行,以及在聲明和調用中指定OUTPUT關鍵字。

例子:

CREATE PROCEDURE gtest (
    @col1 int, 
    @col2 int OUTPUT, 
    @col3 int OUTPUT 
)AS 
SET @[email protected]; 
SET @[email protected]*@col1; 
GO 


DECLARE @out INT, @out3 int; 

EXEC gtest 12, @out output, @out3 output 
SELECT @out, @out3 
0

你在你的執行語句聲明所有分配的輸出參數。