在用户函数中使用if else出错 
--------------
你把你写的帖出来啊

解决方案 »

  1.   

    CREATE FUNCTION FunISPop (@UserID  nvarchar(20),@Password nvarchar(32),@SystemID nvarchar(8)='System') RETURNS  nvarchar(8)ASBEGIN 
    Declare @StrISPop as nvarchar(8)



    if (select count(userid) from userinfo where userid=@userid and userpass=@Password)>0 then 
    @strispop='True'

    else
    @strispop='false'


    Return @strispop

    END
      

  2.   

    CREATE FUNCTION FunISPop(
    @UserID  nvarchar(20),
    @Password nvarchar(32),
    @SystemID nvarchar(8)='System') 
    RETURNS  nvarchar(8)
    AS
    BEGIN 
    Declare @StrISPop as nvarchar(8)
    if exists(select 1 from userinfo where userid=@userid and userpass=@Password)
            set @strispop='True'
    else
    set @strispop='false'
    Return @strispop
    END
      

  3.   

    那么,我想得到这个表中的其他字段的值,应该如何获得呢?select @strpy=py from userinfo where?这样么?
      

  4.   

    select @strpy1=py1,@strpy2=py2,@strpy3=py3  from userinfo where?