1
如何使用過程中的輸出參數?輸出參數SQL Server 2005
如何使用過程中的輸出參數?輸出參數SQL Server 2005
假設您有一個帶有輸出參數的存儲區。您可以調用它並讀取輸出值。
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