sqlserver 带输出参数的存储过程
程序员文章站
2022-07-26 20:34:49
--创建存储过程create procedure proc_stu@sname varchar(20),@pwd varchar(50),@flag bit outputasif exists(select * from dt_manager m where m.user_name=@sname a ......
--创建存储过程
create procedure proc_stu
@sname varchar(20),
@pwd varchar(50),
@flag bit output
as
if exists(
select * from dt_manager m where m.user_name=@sname and m.password=@pwd)
select @flag=1
else
select @flag=0
go
--调用
DECLARE @return_value int
EXEC proc_stu 'admin','2',@return_value output
SELECT @return_value as '返回值'