奇迹sql语句

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

安装百万升级数据库altertableMEMB_INFOaddMemberTypeintNOTNULLdefault0altertableMEMB_INFOaddMemberResetChrNumintNOTNULLdefault0altertableMEMB_INFOaddGetItemDaydatetimeNOTNULLdefault0altertableMEMB_INFOaddJhJfdatetimeNOTNULLdefault0altertableCharacteraddResetLifeintNOTNULLdefault0altertableCharacteraddJfTopointNumintNOTNULLdefault0altertableCharacteraddRestTimedatetimeNULLgo召唤师无法建立打开MUONLINE数据库数据表AccountCharacter选择设计表summoner的默认值(0)改成(1)如果是旧的帐号必须查询分析器里面对MUONLINE数据库运行代码updateAccountCharactersetAccountCharacter.Summoner=1石头卖商店积分存储过程使用查询分析器查询分析增加以下2个储存过程A.CREATEPROCEDUREUP_MEMB_INFO_Update_JF@memb___idvarchar(10),@jfintASUPDATE[MEMB_INFO]SET[jf]=@jf+[jf]WHEREmemb___id=@memb___idGOB.CREATEPROCEDUREDOWN_MEMB_INFO_Update_JF@memb___idvarchar(10),@jfintASUPDATE[MEMB_INFO]SET[jf]=[jf]-@jfWHEREmemb___id=@memb___idGO查询某账号的在线时间SELECT*FROMMEMB_STATWHERE(memb___id='apper88')查询在线时间按降序排列SELECT*FROMMEMB_STATORDERBYOnlineHoursDESC合区后圣导统率为0的改为5000(如果统率还没恢复5000则让他下线,再次执行)UPDATE[shop_MuItem]SETPlusSetPrice=20======================================================================================================================================================减少数据库占用率:backuplogMuOnlinewithNO_LOGbackuplogMuOnlinewithTRUNCATE_ONLYDBCCSHRINKDATABASE(MuOnline)backuplogRankingwithNO_LOGbackuplogRankingwithTRUNCATE_ONLYDBCCSHRINKDATABASE(Ranking)查询最新注册帐号SELECTmemb___id,appl_daysFROMMEMB_INFOORDERBYappl_daysDESC查询倾城家族的人数SELECT*FROM[Character]WHERE(NameLIKE'倾城%')圣导送9999统率:CREATETRIGGER[Leadership]ON[dbo].[Character]afterInsertasUpdate[Character]set[Character].Leadership=9999FromInsertedWhereInserted.Class=64and[Character].accountid=inserted.accountidand[Character].name=inserted.name可以把一个账号下的某个角色,完美转移到另一个账号中usemuonlineexecWZ_MoveCharacter'账号','角色','账号2',0usemuonlineexecWZ_MoveCharacter'账号2','角色','账号',1转回来血色24次修改:USERankinggoUPDATE[Ranking].[dbo].[T_ENTER_CHECK_BC]SET[ToDayEnterCount]=1USEMUONLINEgoUPDATE[Ranking].[dbo].[T_ENTER_CHECK_BC]SET[ToDayEnterCount]=1SET@iMaxEnterCheck=24--老老弥措涝厘啊瓷冉荐SETToDayEnterCount=ToDayEnterCount+1,LastEnterDate=GetDate()改SETToDayEnterCount=ToDayEnterCount+0,LastEnterDate=GetDate()战士.磨剑.圣导上线送300点,法师.MM上线送600点SQL触发器CREATETRIGGER战士送点ONCharacterAFTERINSERTASSETNOCOUNTONUPDATECharacterSETCharacter.LevelUpPoint=600FROMInsertedWhereInserted.Class=16andCharacter.name=Inserted.nameSETNOCOUNTOFFCREATETRIGGER法师送点ONCharacterAFTERINSERTASSETNOCOUNTONUPDATECharacterSETCharacter.LevelUpPoint=1200FROMInsertedWhereInserted.Class=0andCharacter.name=Inserted.nameSETNOCOUNTOFFCREATETRIGGER精灵送点ONCharacterAFTERINSERTASSETNOCOUNTONUPDATECharacterSETCharacter.LevelUpPoint=1200FROMInsertedWhereInserted.Class=32andCharacter.name=Inserted.nameSETNOCOUNTOFFCREATETRIGGER战士送点ONCharacterAFTERINSERTASSETNOCOUNTONUPDATECharacterSETCharacter.LevelUpPoint=300FROMInsertedWhereInserted.Class=16andCharacter.name=Inserted.nameSETNOCOUNTOFFCREATETRIGGER魔剑送点ONCharacterAFTERINSERTASSETNOCOUNTONUPDATECharacterSETCharacter.LevelUpPoint=1200FROMInsertedWhereInserted.Class=48andCharacter.name=Inserted.nameSETNOCOUNTOFFCREATETRIGGER圣导送点ONCharacterAFTERINSERTASSETNOCOUNTONUPDATECharacterSETCharacter.LevelUpPoint=800FROMInsertedWhereInserted.Class=64andCharacter.name=Inserted.nameSETNOCOUNTOFFCREATETRIGGER召唤送点ONCharacterAFTERINSERTASSETNOCOUNTONUPDATECharacterSETCharacter.LevelUpPoint=600FROMInsertedWhereInserted.Class=80andCharacter.name=Inserted.nameSETNOCOUNTOFFCREATETRIGGER角斗士送点ONCharacterAFTERINSERTASSETNOCOUNTONUPDATECharacterSETCharacter.LevelUpPoint=800FROMInsertedWhereInserted.Class=96andCharacter.name=Inserted.nameSETNOCOUNTOFF分别5次运行另外圣导出生统率SQL语句圣导师送9999统率(MSSQL分析)复制以下代码,打开SQL查询分析器适合所有奇迹服务端CREATETRIGGER[Leadership]ON[dbo].[Character]afterInsertasUpdate[Character]set[Character].Leadership=999FromInsertedWhereInserted.Class=64and[Character].accountid=inserted.accountidand[Character].name=inserted.name本文来自:微子科技网游社区[url][/url]更多精彩等着您!======================================================================================================================================================修改所有追28变24:beginsetnocountondeclare@usercountintdeclare@erruserintdeclare@itemcountintdeclare@itemoneintset@usercount=0set@erruser=0set@itemcount=0declare@extckintdeclare@m_uidvarchar(10)--用户IDdeclare@m_namevarchar(10)--角色名declare@m_itemsvarbinary(1200)--收回前物品declare@m_ritemsvarbinary(1200)--收回后物品declare@iintdeclare@m_itmbinary(10)declarecurCURSORforselectc.accountid,c.name,c.Inventoryasitemsfromcharactercwherec.Inventoryisnotnullopencurfetchnextfromcurinto@m_uid,@m_name,@m_itemswhile@@FETCH_STATUS=0--提取成功beginset@itemone=0set@i=0while@i76beginset@m_itm=substring(@m_items,@i*10+1,10)--检查是否有查找的物品ifsubstring(@m_itm,1,1)0xFFand(cast(substring(@m_itm,2,1)astinyint)&3)=3and(cast(substring(@m_itm,8,1)astinyint)&0x40)0beginset@m_itm=substring(@m_itm,1,1)+cast((cast(substring(@m_itm,2,1)astinyint)&0xFE)asbinary(1))+substring(@m_itm,3,8)set@itemone=@itemone+1end--生成新的物品数据if@i1set@m_ritems=@m_itmelseset@m_ritems=@m_ritems+@m_itmset@i=@i+1end--写入begintranupdatecharactersetI

1 / 25
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功