MingHao_Hu

博客园 首页 新随笔 联系 订阅 管理

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表的所有行数

posted on 2012-08-15 08:59  MingHao_Hu  阅读(294)  评论(0编辑  收藏  举报