Kod:
CREATE PROCEDURE npsembol AS
-- Procedure Edited By Longh0rn type LoyaltyMontyly
truncate table np_kings
insert np_kings
select top 100 strUserID, Loyalty, LoyaltyMonthly, 'gokhantasci'
from USERDATA
where Nation = 1
order by Loyalty desc, LoyaltyMonthly desc
truncate table np_kings2
insert np_kings2
select top 100 strUserID, Loyalty, LoyaltyMonthly, 'gokhantasci'
from USERDATA
where Nation = 2
order by Loyalty desc, LoyaltyMonthly desc
declare @KarusD varchar(21), @KarusH varchar(21), @KarusM varchar(21), @KarusS varchar(21), @KarusMi varchar(21), @KarusT varchar(21), @ElmoD varchar(21), @ElmoH varchar(21), @ElmoM varchar(21), @ElmoS varchar(21), @ElmoMi varchar(21), @ElmoT varchar(21)
select @KarusD = struserid from np_kings where nrank = 1
select @KarusH = struserid from np_kings where nrank = 2
select @KarusM = struserid from np_kings where nrank = 3
select @KarusS = struserid from np_kings where nrank = 4
select @KarusMi = struserid from np_kings where nrank = 5
select @KarusT = struserid from np_kings where nrank = 6
select @ElmoD = struserid from np_kings2 where nrank = 1
select @ElmoH = struserid from np_kings2 where nrank = 2
select @ElmoM = struserid from np_kings2 where nrank = 3
select @ElmoS = struserid from np_kings2 where nrank = 4
select @ElmoMi = struserid from np_kings2 where nrank = 5
select @ElmoT = struserid from np_kings2 where nrank = 6
/* Update part wowowo */
update user_personal_rank set strelmouserid = @ElmoD , nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoD), strkarususerid = @karusD, nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @karusD) where nRank = 1
update user_personal_rank set strelmouserid = @ElmoH, nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoH), strkarususerid = @karusH, nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @KarusH) where nRank = 2
update user_personal_rank set strelmouserid = @ElmoM, nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoM), strkarususerid = @KarusM, nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @KarusM) where nRank = 3
update user_personal_rank set strelmouserid = @ElmoS, nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoS), strkarususerid = @KarusS, nkarusLoyaltyMonthly = ( select LoyaltyMonthly from userdata where struserid = @KarusS) where nRank = 4
update user_personal_rank set strelmouserid = @ElmoMi , nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoMi), strkarususerid = @KarusMi, nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @KarusMi) where nRank = 5
update user_personal_rank set strelmouserid = @ElmoT, nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoT), strkarususerid = @KarusT , nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @KarusT) where nRank= 6
/* end of the update */
GO
oto olması icin rank_knights a gir as dan sonra ( exec npsembol ) yaz update_knights a gir as dan sonra exec rank_knights yaz oto grade ve sembolun olr
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.
CREATE PROCEDURE npsembol AS
-- Procedure Edited By Longh0rn type LoyaltyMontyly
truncate table np_kings
insert np_kings
select top 100 strUserID, Loyalty, LoyaltyMonthly, 'gokhantasci'
from USERDATA
where Nation = 1
order by Loyalty desc, LoyaltyMonthly desc
truncate table np_kings2
insert np_kings2
select top 100 strUserID, Loyalty, LoyaltyMonthly, 'gokhantasci'
from USERDATA
where Nation = 2
order by Loyalty desc, LoyaltyMonthly desc
declare @KarusD varchar(21), @KarusH varchar(21), @KarusM varchar(21), @KarusS varchar(21), @KarusMi varchar(21), @KarusT varchar(21), @ElmoD varchar(21), @ElmoH varchar(21), @ElmoM varchar(21), @ElmoS varchar(21), @ElmoMi varchar(21), @ElmoT varchar(21)
select @KarusD = struserid from np_kings where nrank = 1
select @KarusH = struserid from np_kings where nrank = 2
select @KarusM = struserid from np_kings where nrank = 3
select @KarusS = struserid from np_kings where nrank = 4
select @KarusMi = struserid from np_kings where nrank = 5
select @KarusT = struserid from np_kings where nrank = 6
select @ElmoD = struserid from np_kings2 where nrank = 1
select @ElmoH = struserid from np_kings2 where nrank = 2
select @ElmoM = struserid from np_kings2 where nrank = 3
select @ElmoS = struserid from np_kings2 where nrank = 4
select @ElmoMi = struserid from np_kings2 where nrank = 5
select @ElmoT = struserid from np_kings2 where nrank = 6
/* Update part wowowo */
update user_personal_rank set strelmouserid = @ElmoD , nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoD), strkarususerid = @karusD, nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @karusD) where nRank = 1
update user_personal_rank set strelmouserid = @ElmoH, nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoH), strkarususerid = @karusH, nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @KarusH) where nRank = 2
update user_personal_rank set strelmouserid = @ElmoM, nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoM), strkarususerid = @KarusM, nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @KarusM) where nRank = 3
update user_personal_rank set strelmouserid = @ElmoS, nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoS), strkarususerid = @KarusS, nkarusLoyaltyMonthly = ( select LoyaltyMonthly from userdata where struserid = @KarusS) where nRank = 4
update user_personal_rank set strelmouserid = @ElmoMi , nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoMi), strkarususerid = @KarusMi, nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @KarusMi) where nRank = 5
update user_personal_rank set strelmouserid = @ElmoT, nElmoLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @ElmoT), strkarususerid = @KarusT , nkarusLoyaltyMonthly = (select LoyaltyMonthly from userdata where struserid = @KarusT) where nRank= 6
/* end of the update */
GO
oto olması icin rank_knights a gir as dan sonra ( exec npsembol ) yaz update_knights a gir as dan sonra exec rank_knights yaz oto grade ve sembolun olr
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.