csjsias

博客园 首页 新随笔 联系 订阅 管理

2011年12月3日 #

摘要: DECLARE tables_cursor CURSOR FOR SELECT top 100 name FROM sysobjects WHERE type = 'U' order by name OPEN tables_cursor DECLARE @tablename varchar(30), @quote char(1) SELECT @quote = '' FETCH NEXT FROM tables_cursor INTO @tablename WHILE (@@fetch_status <> -1) BEGIN EXEC ('S 阅读全文
posted @ 2011-12-03 08:15 快乐121 阅读(182) 评论(0) 推荐(0)

摘要: SQL Server script to rebuild all indexes for all tables and all databases对服务器上所有数据库的所有表重建索引。原文地址:http://www.mssqltips.com/sqlservertip/1367/sql-server-script-to-rebuild-all-indexes-for-all-tables-and-all-databases/感谢: Greg RobidouxDECLARE @Database VARCHAR(255) DECLARE @Table VARCHAR(255)DECLARE @cm 阅读全文
posted @ 2011-12-03 08:11 快乐121 阅读(517) 评论(0) 推荐(0)