–创建存储过程
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 ‘返回值’