jinwenjian 发表于 2009-6-23 12:07:20

处理重复上号

CREATE PROCEDURE ACCOUNT_LOGIN
@AccountID        varchar(21),
@Password        varchar(13),
@nRet                smallint        OUTPUT

AS
delete from currentuser where straccountid = @AccountID

DECLARE @Nation tinyint, @CharNum smallint
SET @Nation = 0
SET @CharNum = 0

DECLARE @pwd varchar(13)

SET @pwd = null

SELECT @pwd = strPasswd FROM . WHERE strAccountID = @AccountID and idays=6
IF @pwd IS null
BEGIN
        SET @nRet = 4
             --SET @nRet = 4
        RETURN
END

ELSE IF @pwd <> @Password
BEGIN
        SET @nRet = 3
             --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 = @Nation+1
             --SET @nRet = 1
        RETURN
END
GO

dean98 发表于 2009-10-13 12:55:59

支持了

被判无妻 发表于 2009-10-13 15:02:41

强力支持!!!!

孔雀胆 发表于 2009-10-14 19:46:35

收藏学习中。。。。。。。。。。。。。。

gjbation1 发表于 2009-10-16 22:10:19

好好好,多谢了

gjbation1 发表于 2009-10-17 21:18:25

我也想知道...

lvevl 发表于 2010-10-30 13:30:25

页: [1]
查看完整版本: 处理重复上号