Merhabalar arkadaşlar.
Kendi account_login , account_logia , account_logout ve myst_login ' imi paylaşıyorum. Sorunlu olan bir databasede denedim ve sorun çözüldü. Umarım sizinde sorununuzu çözer. Oto üyelik aktiftir.
Öncelikle Enterprise Manager giriyoruz , sonrasında databasemizi seçip Stored Procedures kısmına geliyoruz. Orada sırasıyla şunları yapacağız.
Account_Login aç ; tümünü sil ve bunu yapıştırıp Apply tıklayın.
Kod:
CREATE PROCEDURE ACCOUNT_LOGIN
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT
AS
delete from currentuser where straccountid = @AccountID
---Author : ceronimo04---
declare @cnt BigInt
declare @nDays smallint
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
select @cnt = count(straccountid) from currentuser
select @nDays = count(nDays) from PREMIUM_SERVICE where straccountid = @AccountID
if @cnt > 40 and @nDays = '0'
begin
set @nRet = 0
end
if @cnt > 40 and @nDays = null
begin
set @nRet = 0
end
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
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
Account_Logia aç ; tümünü sil ve bunu yapıştırıp Apply tıklayın. Eğer account_logia yok ise bunu Query Analyzer 'den yapıştırıp F5 ' e basın.
Kod:
CREATE PROCEDURE ACCOUNT_LOGIA
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT
AS
--CurrentUserdan Silelim
delete from currentuser where straccountid = @AccountID
-- Oto Üyelik
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
-- Author : ceronimo04
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 @PremiumServiceDEC varchar(21)
select @PremiumServiceDEC = count(straccountid) FROM premium_service WHERE strAccountID = @AccountID
if @PremiumServiceDEC = 0
begin
insert into PREMIUM_SERVICE (strAccountID, strType, nDays) VALUES (@AccountID, 1, 3)
end
SET @nRet = 1
RETURN
GO
Account_Logout açın ; tümünü silin ve bunu yapıştırıp Apply tıklayın.
Kod:
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
Myst_Login açın ; tümünü silin ve bunu yapıştırıp Apply tıklayın. Eğer yok ise Query Analyzer açıp bu kodu yapıştırın ve F5 yapın.
Kod:
CREATE PROCEDURE MYST_LOGIN
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT
AS
--CurrentUserdan Silelim
delete from currentuser where straccountid = @AccountID
-- Oto Üyelik
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
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
IF @pwd IS null
BEGIN
SET @nRet = 0
RETURN
END
ELSE IF @pwd @Password
BEGIN
SET @nRet = 0
RETURN
END
DECLARE @PremiumServiceDEC varchar(21)
select @PremiumServiceDEC = count(straccountid) FROM premium_service WHERE strAccountID = @AccountID
if @PremiumServiceDEC = 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
RETURN
END
GO
İyi günler , kolay gelsin.
Kullanımı ...
1 Başlat > Tüm Programlar > Microsoft SQL Server > Query Analyzer ‘ a giriyoruz.
2 SQL Server’ a bağlanıyoruz ve açılan ekranda ” master ” yerine ” DBmizi ” seçiyoruz.
3 Seçtikten sonra aşağıdaki kodu kopyalayıp , yapıştırıyoruz ve F5 yaparak kodumuzu uyguluyoruz.
Alıntı Arkadaşlar Fakat Bu Kodlar Doğru Tahminimce Başıma Gelmişti Dikkatli Uygularsanız Sizde Çözersiniz Az Bilgi Yeterli
Kendi account_login , account_logia , account_logout ve myst_login ' imi paylaşıyorum. Sorunlu olan bir databasede denedim ve sorun çözüldü. Umarım sizinde sorununuzu çözer. Oto üyelik aktiftir.
Öncelikle Enterprise Manager giriyoruz , sonrasında databasemizi seçip Stored Procedures kısmına geliyoruz. Orada sırasıyla şunları yapacağız.
Account_Login aç ; tümünü sil ve bunu yapıştırıp Apply tıklayın.
Kod:
CREATE PROCEDURE ACCOUNT_LOGIN
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT
AS
delete from currentuser where straccountid = @AccountID
---Author : ceronimo04---
declare @cnt BigInt
declare @nDays smallint
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
select @cnt = count(straccountid) from currentuser
select @nDays = count(nDays) from PREMIUM_SERVICE where straccountid = @AccountID
if @cnt > 40 and @nDays = '0'
begin
set @nRet = 0
end
if @cnt > 40 and @nDays = null
begin
set @nRet = 0
end
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
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
Account_Logia aç ; tümünü sil ve bunu yapıştırıp Apply tıklayın. Eğer account_logia yok ise bunu Query Analyzer 'den yapıştırıp F5 ' e basın.
Kod:
CREATE PROCEDURE ACCOUNT_LOGIA
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT
AS
--CurrentUserdan Silelim
delete from currentuser where straccountid = @AccountID
-- Oto Üyelik
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
-- Author : ceronimo04
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 @PremiumServiceDEC varchar(21)
select @PremiumServiceDEC = count(straccountid) FROM premium_service WHERE strAccountID = @AccountID
if @PremiumServiceDEC = 0
begin
insert into PREMIUM_SERVICE (strAccountID, strType, nDays) VALUES (@AccountID, 1, 3)
end
SET @nRet = 1
RETURN
GO
Account_Logout açın ; tümünü silin ve bunu yapıştırıp Apply tıklayın.
Kod:
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
Myst_Login açın ; tümünü silin ve bunu yapıştırıp Apply tıklayın. Eğer yok ise Query Analyzer açıp bu kodu yapıştırın ve F5 yapın.
Kod:
CREATE PROCEDURE MYST_LOGIN
@AccountID varchar(21),
@Password varchar(13),
@nRet smallint OUTPUT
AS
--CurrentUserdan Silelim
delete from currentuser where straccountid = @AccountID
-- Oto Üyelik
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
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
IF @pwd IS null
BEGIN
SET @nRet = 0
RETURN
END
ELSE IF @pwd @Password
BEGIN
SET @nRet = 0
RETURN
END
DECLARE @PremiumServiceDEC varchar(21)
select @PremiumServiceDEC = count(straccountid) FROM premium_service WHERE strAccountID = @AccountID
if @PremiumServiceDEC = 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
RETURN
END
GO
İyi günler , kolay gelsin.
Kullanımı ...
1 Başlat > Tüm Programlar > Microsoft SQL Server > Query Analyzer ‘ a giriyoruz.
2 SQL Server’ a bağlanıyoruz ve açılan ekranda ” master ” yerine ” DBmizi ” seçiyoruz.
3 Seçtikten sonra aşağıdaki kodu kopyalayıp , yapıştırıyoruz ve F5 yaparak kodumuzu uyguluyoruz.
Alıntı Arkadaşlar Fakat Bu Kodlar Doğru Tahminimce Başıma Gelmişti Dikkatli Uygularsanız Sizde Çözersiniz Az Bilgi Yeterli