• HyperFilter | DoS Protection | DDoS Protection | DoS Mitigation | DDoS Mitigation | AntiDoS | AntiDDoS | Proxy Shielding

+Captain SORUNUN COZUMU

Katılım
10 Mayıs 2013
Mesajlar
1,203
Knights Tablosunun güncellenmemesi.

Rank_Knights Prosedürünün Bozuk olması







Sorunu Çözelim :



Önce War_Capitan Prosedürümüzü girelim.[Kodu Girişte Hata Atarsa Create Yazan bölüme ALTER Yazın düzelecektir ! ]





-----------------------------------------------------------------------------





CREATE PROCEDURE WAR_CAPITAN

@UserId varchar(21),

@Nrow int

AS



DECLARE @Race int,@Nation int



Select @Race = Race From USERDATA Where strUserId = @UserId

Select @Nation = Nation From USERDATA Where strUserId = @UserId



--KO-FOX

IF @Race = 1 and @Nrow = 1

BEGIN

Update USERDATA Set Race = 5 Where strUserId = @UserId

END

ELSE IF @Race = 2 and @Nrow = 1

BEGIN

Update USERDATA Set Race = 6 Where strUserId = @UserId

END

ELSE IF @Race = 3 and @Nrow = 1

BEGIN

Update USERDATA Set Race = 7 Where strUserId = @UserId

END

ELSE IF @Race = 4 and @Nrow = 1

BEGIN

Update USERDATA Set Race = 8 Where strUserId = @UserId

END

ELSE IF @Race = 11 and @Nrow = 1

BEGIN

Update USERDATA Set Race = 14 Where strUserId = @UserId

END

ELSE IF @Race = 12 and @Nrow = 1

BEGIN

Update USERDATA Set Race = 15 Where strUserId = @UserId

END

ELSE IF @Race = 13 and @Nrow = 1

BEGIN

Update USERDATA Set Race = 16 Where strUserId = @UserId

END

--KO-FOX

IF @Race = 5 and @Nrow = 2

BEGIN

Update USERDATA Set Race = 1 Where strUserId = @UserId

END

ELSE IF @Race = 6 and @Nrow = 2

BEGIN

Update USERDATA Set Race = 2 Where strUserId = @UserId

END

ELSE IF @Race = 7 and @Nrow = 2

BEGIN

Update USERDATA Set Race = 3 Where strUserId = @UserId

END

ELSE IF @Race = 8 and @Nrow = 2

BEGIN

Update USERDATA Set Race = 4 Where strUserId = @UserId

END

ELSE IF @Race = 14 and @Nrow = 2

BEGIN

Update USERDATA Set Race = 11 Where strUserId = @UserId

END

ELSE IF @Race = 15 and @Nrow = 2

BEGIN

Update USERDATA Set Race = 12 Where strUserId = @UserId

END

ELSE IF @Race = 16 and @Nrow = 2

BEGIN

Update USERDATA Set Race = 13 Where strUserId = @UserId

END

GO

-------------------------------------------------------------------





sonra bunu uygulayın





CREATE PROCEDURE RANK_KNIGHTS

AS

--Procedure By ZaGoR / Smallerko

-- Edit Ko-FoX

SET NOCOUNT ON

DECLARE @KnightsIndex smallint

DECLARE @SumLoyalty int

DECLARE job1 CURSOR FOR

SELECT IDNum FROM KNIGHTS

OPEN job1

FETCH NEXT FROM job1

INTO @KnightsIndex

WHILE @@fetch_status = 0

BEGIN

if @SumLoyalty is null

begin

SET @SumLoyalty = 0

end

SELECT @SumLoyalty=Sum(Loyalty) FROM USERDATA WHERE Knights = @KnightsIndex and City <> 255

IF @SumLoyalty <> 0

UPDATE KNIGHTS SET Points = @SumLoyalty WHERE IDNum = @KnightsIndex

FETCH NEXT FROM job1

INTO @KnightsIndex

END

CLOSE job1

DEALLOCATE job1

SET NOCOUNT OFF

UPDATE KNIGHTS SET Ranking=0 WHERE Ranking>0

EXEC KNIGHTS_RATING_UPDATE

DECLARE @Knights_1 smallint

DECLARE @Knights_2 smallint

DECLARE @Knights_3 smallint

DECLARE @Knights_4 smallint

DECLARE @Knights_5 smallint

SELECT @Knights_1 = shIndex FROM KNIGHTS_RATING WHERE nRank=1

SELECT @Knights_2 = shIndex FROM KNIGHTS_RATING WHERE nRank=2

SELECT @Knights_3 = shIndex FROM KNIGHTS_RATING WHERE nRank=3

SELECT @Knights_4 = shIndex FROM KNIGHTS_RATING WHERE nRank=4

SELECT @Knights_5 = shIndex FROM KNIGHTS_RATING WHERE nRank=5

UPDATE KNIGHTS SET Ranking=1 WHERE IDNum=@Knights_1

UPDATE KNIGHTS SET Ranking=2 WHERE IDNum=@Knights_2

UPDATE KNIGHTS SET Ranking=3 WHERE IDNum=@Knights_3

UPDATE KNIGHTS SET Ranking=4 WHERE IDNum=@Knights_4

UPDATE KNIGHTS SET Ranking=5 WHERE IDNum=@Knights_5

GO



--------------------------------------------------------

Ve son olarak eğer düzelip düzelmediğini denemek isterseniz



Konuya Cevap yazdıgınız icin tesekurler

Kod:

Update knights set points = '999999' where IDNAME = 'Clan İsmi'

-------------------------------------------------------------

Kod:

EXEC RANK_KNIGHTS
 
Geri
Üst