KRAL EKLEME :
CREATE PROCEDURE [dbo].[KRAL_EKLE]
@CharID varchar(21)
AS
/*
*/
BEGIN
DECLARE @Nation tinyint,@clanID smallint,@ClanName varchar(31),@AccID varchar(21)
select @Nation = Nation from USERDATA where strUserId = @CharID
select @ClanID = sIDnum from KNIGHTS_USER where StrUserID = @CharID
select @ClanName = IDName from KNIGHTS where IDNum = @ClanID
select @AccID = strAccountID from ACCOUNT_CHAR where @CharID = strCharID1 or @CharID = strCharID2 or @CharID = strCharID3
END
BEGIN
update KING_SYSTEM set strKingName = @CharID where byNation = @Nation
insert into [KING_ELECTION_LIST] Values(1, @Nation, @ClanID, @CharID, 0)
insert into [KING_CANDIDACY_NOTICE_BOARD] Values(@CharID, @Nation, 20, 0)
insert into [KING_BALLOT_BOX] Values(@AccID, @CharID, @Nation, @ClanName)
update USERDATA set Rank = '1' where strUserId = @CharID
print 'Tebrikler, Kullanıcı Basarıyla Kral Olmustur. '
END
GO
exec KRAL_EKLE 'nick'
KRAL SİLME :
CREATE PROCEDURE [dbo].[KRAL_Sil]
@CharID varchar(21)
AS
/*
0uikShare Tarafından Yazılmıştır, Üstünde Oynama Yapan Toptur, Nonoştur
*/
update KING_SYSTEM set strKingName = ' ' where strKingName = @CharID
delete from KING_ELECTION_LIST where strname = @CharID
delete from KING_CANDIDACY_NOTICE_BOARD where StrUserID = @CharID
delete from KING_BALLOT_BOX where StrCharID = @CharID
update USERDATA set Rank = '0' where strUserId = @CharID
print 'Kullanıcının Krallığı Başarı ile Silinmiştir. '
GO
EXEC Kral_Sil 'Nick'