evaydd 发表于 2009-9-3 16:33:34

ACCOUNT_LOGIN 重写

/********************** Modify By JianweisDate: 2008-5-11 ************************/
/*** 增加踢号 ***/
/***未注册提示***/
/***点数不够***/
CREATE PROCEDURE ACCOUNT_LOGIN
@AccountID    varchar(21),
@Password    varchar(13),
@nRet      smallint    OUTPUT
AS
DECLARE @Nation tinyint, @CharNum smallint,@Days smallint
SET @Nation = 0
SET @CharNum = 0
SET @Days = 0
DECLARE @pwd varchar(13)
SET @pwd = null


SELECT @nRet = count(*) FROM . WHERE strAccountID =@AccountID

IF@nRet < 1
BEGIN
          SET @nRet = 2
          RETURN
END

SELECT @pwd = strPasswd , @Days = idays FROM . WHERE strAccountID = @AccountID

IF@Days < 1
BEGIN
      SET @nRet = 11
      RETURN
END

IF @pwd IS null
BEGIN
    --SET @nRet = 0
            SET @nRet = 4
    RETURN
END
ELSE IF @pwd <> @Password
BEGIN
    --SET @nRet = 0
            SET @nRet = 3
    RETURN
END


SELECT @nRet = count(*) FROM . WHEREstrAccountID =@AccountID
IF @nRet > 0
BEGIN
      SET @nRet = 5
      RETURN
END

SELECT @Nation = bNation, @CharNum = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
IF @@ROWCOUNT = 0
BEGIN
    SET @nRet = 1
    RETURN
END
IF @CharNum = 0
BEGIN
    SET @nRet = 1
    RETURN
END
ELSE
BEGIN
          SET @nRet = 1
          RETURN
END
GO

legendman 发表于 2009-9-4 01:40:46

怎么用

w222222 发表于 2009-9-24 23:31:32

是修改存储过程吗
页: [1]
查看完整版本: ACCOUNT_LOGIN 重写