红月私服1级完成所有任务教程

红月私服1级完成所有任务,需要在数据库里执行以下代码

CREATE TRIGGER TR_UPDATE_TBLGAMEID1 ON TBLGAMEID1
FOR UPDATE
AS
IF UPDATE(Lvl)
BEGIN
DECLARE @GAMEID CHAR(14)
DECLARE @LEVEL INT
DECLARE crGAMEID CURSOR FOR SELECT GAMEID,LVL FROM INSERTED
OPEN crGAMEID
FETCH NEXT FROM crGAMEID INTO @GAMEID,@LEVEL
WHILE @@fetch_status = 0
BEGIN
IF @LEVEL=1
BEGIN
UPDATE TBLGAMEID1 SET StoryQuestState=131071 WHERE GAMEID=@GAMEID
END
FETCH NEXT FROM crGAMEID INTO @GAMEID,@LEVEL
END
close crGAMEID
deallocate crGAMEID
END