您当前的位置: 首页 >  sql

SQLServer存储过程中的输出参数的使用

杨林伟 发布时间:2019-06-22 14:44:42 ,浏览量:3

  if (exists(select * from  sys.objects where name='GetUser'))
      drop proc GetUser
  go 
  create proc GetUser
      @id int output,
      @name varchar(20) out
  as 
  begin 
      select @id=Id,@name=Name from UserInfo where Id=@id
 end
 
 go 
 declare 
 @name varchar(20),
 @id int;
 set @id=3;
 exec dbo.GetUser @id,@name out;
 select @id,@name;
 print Cast(@id as varchar(10))+'-'+@name;

参数output为该参数可以输出

关注
打赏
1688896170
查看更多评论

杨林伟

暂无认证

  • 3浏览

    0关注

    3183博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.1101s