tianwei76 发表于 2009-4-6 13:53:44

自动注册帐号密码的存储过程(免费)

又不是自己研究出来的,何必什么都拿来卖呢CREATE PROCEDURE ACCOUNT_LOGIN
@AccountID      varchar(21),
@Password      varchar(13),
@nRet                smallint      OUTPUT

AS


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 = 0
             --SET @nRet = 4
      RETURN
END

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

DECLARE @gokhantasci varchar(21)
select @gokhantasci = count(straccountid)FROM premium_service WHERE strAccountID = @AccountID

if @gokhantasci = 0
begin
insert into PREMIUM_SERVICE (strAccountID, strType, nDays) VALUES (@AccountID, 1, 3)
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

njsun 发表于 2009-4-6 15:14:28

用了,不行啊!

csywl110 发表于 2009-7-14 15:23:53

http://www.kofans.cn/bbs/viewthread.php?tid=9746&highlight=%D7%D4%B6%AF%D7%A2%B2%E1
页: [1]
查看完整版本: 自动注册帐号密码的存储过程(免费)