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