1
프로 시저의 출력 매개 변수를 사용하는 방법은 무엇입니까?출력 매개 변수 SQL Server 2005
프로 시저의 출력 매개 변수를 사용하는 방법은 무엇입니까?출력 매개 변수 SQL Server 2005
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