SQL Server数据库所有表重建索引
2009-05-19 08:23
302 查看
USE My_Database;
DECLARE @name varchar(100)
DECLARE authors_cursor CURSOR FOR
Select [name] from sysobjects where xtype='u' order by id
OPEN authors_cursor
FETCH NEXT FROM authors_cursor INTO @name
WHILE @@FETCH_STATUS = 0
BEGIN
DBCC DBREINDEX (@name, '', 90)
FETCH NEXT FROM authors_cursor
INTO @name
END
deallocate authors_cursor
DECLARE @name varchar(100)
DECLARE authors_cursor CURSOR FOR
Select [name] from sysobjects where xtype='u' order by id
OPEN authors_cursor
FETCH NEXT FROM authors_cursor INTO @name
WHILE @@FETCH_STATUS = 0
BEGIN
DBCC DBREINDEX (@name, '', 90)
FETCH NEXT FROM authors_cursor
INTO @name
END
deallocate authors_cursor
相关文章推荐
- SQL Server数据库所有表重建索引
- Oracle重建所有表和索引
- 使用SP_MSForEachTable重建一个数据库中所有的索引
- SQL SERVER数据库维护与重建索引
- oracle 重建索引以及导出所有的索引脚本(可以解决还原数据库文件时先还原数据,在重新用脚本创建索引)
- Oracle 重建所有表的索引的存储过程 (重建索引)
- ORACLE重建所有的索引
- 重建数据库表所有索引
- SQL SERVER数据库维护与重建索引
- T-SQL重建所有数据库的所有表的索引
- 一次性重建所有聚集索引,方便释放空间
- 常用脚本--在线重建或重整实例下所有索引
- 去除某SQL Server数据库中所有约束,索引,触发器,统计的代码
- [S]SQL SERVER数据库维护与重建索引
- 重建所有索引
- sqlserver重建所有索引的存储过程
- SQL Server数据库所有表索引性能分析
- orcl索引失效,重建所有索引,或者根据命名空间重建所有索引
- Oracle 重建所有表的索引的存储过程 (重建索引)
- sqlserver重建所有索引存储过程