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其什么作用,我知道这问题很白痴!

解决方案 »

  1.   

    输出参数可以返回这个@Info参数
      

  2.   

    便声明一个smallint变量,即可

    --声明变量@t
    ...
    --给变量赋初始值
    ...
    --执行过程
    EXECUTE 过程名 '输入参数@period的值', @no_id = @t OUTPUT,@info OUTPUT
      

  3.   

    declare @info int
    exec wsp @info out
    print @info
      

  4.   

    输出参数。
    exec wsp @uname,@pword,@info output
    select @info
      

  5.   


    declare @info int
    exec wsp 'zhangsan','asdf',@info output
    select @info
      

  6.   

    在执行存储过程时,用一个变量来接受存储,或者可以PRINT出来
      

  7.   

    请问在delphi里如何获取@info值