将表specialcarorder中的ordercode字段更新为自增的数declare @bid intdeclare @wincode intset @wincode=900001declare cur cursorread_onlyfor select id from specialcarorder where activetype=8182open curfetch next from cur into @bidwhile(@@fetch_status=0)beginupdate specialcarorder set ordercode...【阅读全文】
最近遇到一个奇怪的问题,客户环境数据库的恢复模式为简单,但其日志文件一直无法收缩,即使重启数据库服务也一样。数据库版本为SQL Server2008 SP2,并且配置了订阅,复制订阅的状态是正常的。通过分析与查找资料后发现这是SQL Server 2008的升级bug,具体来说是复制订阅升级脚本的bug导致的问题,现将分析过程和解决方...【阅读全文】
官方手册中关于Flush tables的介绍, Closes all open tables, forces all tables in use to be closed, and flushes the query cache. FLUSH TABLES also removes all query results from the query cache, like the RESET QUERY CACHE statement.其解析就是关闭所有已打开的表对象,同时将查询缓存中的结果清空。就是说...【阅读全文】