首页 > 数据库技术 > 详细

sql server存储过程

时间:2015-08-25 23:09:09      阅读:273      评论:0      收藏:0      [点我收藏+]

在调用有参数的存储过程时,传入的参数一定要与存储过程声明的参数顺序一样,

例如:一下定义了一个usps_Find存储过程,需要传入两个参数isExist(output传出参数),name

 1 create proc usp_Find
 2 
 3 @isExist int output,
 4 @name nvarchar(50) 
 5 
 6 as 
 7 begin
 8     if exists (select * from UserInfo where userName=@name)
 9       begin
10       set @isexist=1
11       end
12     else
13       begin
14       set @isexist=0
15       end
16 end

在调用上面存储过程时应该这样写

declare @isExist int
exec usp_Find @isExist output,马云‘  --写成这样:exec usp_Find ‘马云‘,@isExist output会报错

 

sql server存储过程

原文:http://www.cnblogs.com/taohonggou/p/4758621.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!