Create procedure [dbo].[test]
@test1 int output
as
BEGIN
select @test1=count(*) from Users
end
以下是调用存储过程
DECLARE @test int
Exec [test] @test output //需要注意的是如果想要获得输出参数的值,在调用的过程中output关键字必须加上,不然默认是输入参数
select @test //这个输出的是users表的所有行数
Create procedure [dbo].[test]
@test1 int output
as
BEGIN
select @test1=count(*) from Users
end
以下是调用存储过程
DECLARE @test int
Exec [test] @test output //需要注意的是如果想要获得输出参数的值,在调用的过程中output关键字必须加上,不然默认是输入参数
select @test //这个输出的是users表的所有行数