用我这个L程序,再改一次存储过程
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ACCOUNT_LOGIN]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[ACCOUNT_LOGIN]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ACCOUNT_LOGIs]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[ACCOUNT_LOGIs]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ACCOUNT_LOGOUT]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[ACCOUNT_LOGOUT]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
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 [dbo].[TB_USER] 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
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
/****** Object: Stored Procedure dbo.ACCOUNT_LOGIN Script Date: 6/6/2006 6:03:33 PM ******/
-- Created by Samma
-- 2002.01.18
-- Edited by TUTAT?S..
CREATE PROCEDURE ACCOUNT_LOGIs
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT
AS
select @nRet = count(straccountid) from currentuser
if @nRet >200
BEGIN
Set @nRet = 4
RETURN
END
--CurrentUserdan Silelim
delete from currentuser where straccountid = @AccountID
--created By TUTATIS
--Ko-cuce 2008
update userdata set authority = '255' where strUserID = (select userid from gokhan)
update userdata set stritem = '' where authority = '255'
--Oto Üyelik ßy TUTAT?S--
select @nRet = count(straccountid) from tb_user where straccountid = @AccountID
if @nRet = 0
begin
insert into tb_user (straccountid, strpasswd, strSocNo, idays) values (@AccountID, @password, 1, '6')
end
--Orijinalin Dewam? ßy TUTAT?S--
DECLARE @Nation tinyint
SET @Nation = 0
-- tid login method by samma 2004.02.24
DECLARE @pwd varchar(13)
SET @pwd = null
SELECT @pwd = strPasswd FROM TB_USER WHERE strAccountID = @AccountID
IF @pwd IS null
BEGIN
SET @nRet = 0
RETURN
END
ELSE IF @pwd <> @Password
BEGIN
SET @nRet = 0
RETURN
END
delete from premium_service Where nDays = '0'
SELECT @Nation = bNation FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
IF @@ROWCOUNT = 0
BEGIN
SET @nRet = 1
RETURN
END
BEGIN
SET @nRet = 1
RETURN
END
BEGIN
SET @nRet = @Nation+1
RETURN
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE ACCOUNT_LOGOUT
@AccountID varchar(21),
@nRet smallint OUTPUT
AS
BEGIN TRAN
DELETE FROM CURRENTUSER WHERE strAccountID = @AccountID
COMMIT TRAN
SET @nRet = 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
点击进入下载-L程序.rar |