当前位置:首页>>游戏信息>>更新于:2009/6/30 21:33:31 |
|
|
删除****数据SQL脚本 |
删除****数据SQL脚本
DECLARE@usernamechar(15)
DECLARED_lj_cursorCURSORFOR
SELECT[FLD_CHARACTER]FROM[game1].[dbo].[TBL_CHARACTER]
WHERE[FLD_DELETED]=1OR([FLD_LEVEL]<21ANDFLD_UPDATEDATETIME<'2004-9-14')
OPEND_lj_cursor
FETCHNEXTFROMD_lj_cursorINTO@username
WHILE@@FETCH_STATUS=0
BEGIN
PRINT'正在删除'+@username+'的相关资料......'
DELETEFROM[game1].[dbo].[TBL_MAGIC]WHERE[FLD_CHARACTER]=@username
DELETEFROM[game1].[dbo].[TBL_ITEM]WHERE[FLD_CHARACTER]=@username
DELETEFROM[game1].[dbo].[TBL_SAVEDITEM]WHERE[FLD_CHARACTER]=@username
DELETEFROM[game1].[dbo].[TBL_QUEST]WHERE[FLD_CHARACTER]=@username
DELETEFROM[game1].[dbo].[TBL_FACEIMG]WHERE[FLD_USERNAME]=@username
DELETEFROM[game1].[dbo].[TBL_SUBHUMAN]WHERE[FLD_CHARACTER]=@username
DELETEFROM[game1].[dbo].[TBL_ABILITY]WHERE[FLD_CHARACTER]=@username
DELETEFROM[game1].[dbo].[TBL_CHARACTER]WHERE[FLD_CHARACTER]=@username
DELETEFROM[game1].[dbo].[TBL_ITEMMARKET]WHERE[FLD_SELLWHO]=@username
FETCHNEXTFROMD_lj_cursorINTO@username
END
CLOSED_lj_cursor
DEALLOCATED_lj_cursor
===================================
注意:使用前备份你game1的数据库,这个脚本是将已被用户删除的人物且2004年9月14日前没到21级的人物全部删除。
[FLD_DELETED]=1OR([FLD_LEVEL]<21ANDFLD_UPDATEDATETIME<'2004-9-14')
上面这段就是控制时间等级的。21和2004-9-14。自行修改适合自己的就可以了。
===================================
不会用SQL查询分析器,请自行查找应用教程或说明。
|
|
|
|
|