您的位置:首页 > 数据库

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: