create proc wsp
@uname varchar(50),
@pword varchar(50),
@info int output
as
if exists(select 1 from admin_info where uname=@uname)--用户存在
begin
if exists(select 1 from admin_info where uname=@uname and pword=@pword) --用户和密码正确
set @info=1
else --用户存在。密码不正确
set @info=2
end
else --用户不存在
set @info=3---------------------
@info in output 这里的output其什么作用,我知道这问题很白痴!
@uname varchar(50),
@pword varchar(50),
@info int output
as
if exists(select 1 from admin_info where uname=@uname)--用户存在
begin
if exists(select 1 from admin_info where uname=@uname and pword=@pword) --用户和密码正确
set @info=1
else --用户存在。密码不正确
set @info=2
end
else --用户不存在
set @info=3---------------------
@info in output 这里的output其什么作用,我知道这问题很白痴!
如
--声明变量@t
...
--给变量赋初始值
...
--执行过程
EXECUTE 过程名 '输入参数@period的值', @no_id = @t OUTPUT,@info OUTPUT
exec wsp @info out
print @info
exec wsp @uname,@pword,@info output
select @info
declare @info int
exec wsp 'zhangsan','asdf',@info output
select @info