Produrcer Lar Bolumune New Proc. Diyorsunuz ?çindeki CreaT Kodunu SiLip
Tamamen Bu Kodu Yap?st?r!
-- Bu Kod ByTroJan Taraf?ndan EditLenmi?tir.
-- bY Mr.Zapp
CREATE PROCEDURE ilk5g0 AS
exec rank_knights
update knights set points = '999999',ranking = '0'
update knights set points = '999999',ranking = '1'
where idname = (Select strname from KNIGHTS_RATING where nrank = 1)
update knights set points = '999999',ranking = '1'
where idname = (Select strname from KNIGHTS_RATING where nrank = 2)
update knights set points = '999999',ranking = '1'
where idname = (Select strname from KNIGHTS_RATING where nrank = 3)
update knights set points = '999999',ranking = '1'
where idname = (Select strname from KNIGHTS_RATING where nrank = 4)
update knights set points = '999999',ranking = '1'
where idname = (Select strname from KNIGHTS_RATING where nrank = 5)
sonra..
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
-- ranking
UPDATE KNIGHTS SET Ranking=0 WHERE Ranking>0
-- ranking procedure call
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_1UPDATE KNIGHTS SET Ranking=2 WHERE
IDNum=@Knights_2UPDATE KNIGHTS SET Ranking=3 WHERE
IDNum=@Knights_3UPDATE KNIGHTS SET Ranking=4 WHERE
IDNum=@Knights_4UPDATE KNIGHTS SET Ranking=5 WHERE
IDNum=@Knights_5GO