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表的所有行数
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3