2009-08-26 5 views

답변

4

sproc에 출력 매개 변수가 있다고 가정합니다. 이것을 호출하고 출력 값을 읽을 수 있습니다.

CREATE PROCEDURE AddOne 
    @val int, 
    @valPlusOne int out 

AS 
BEGIN 
    SET NOCOUNT ON; 

    SET @valPlusOne = @val + 1 
END 
GO 

--This is used to store the output 
declare @PlusOne int 

--This calls the stored procedure setting the output parameter 
exec AddOne 1, @[email protected] OUT 

--This displays the value of the output param 
select @Plusone