标签:
USE DatabaseName --数据库名称
DECLARE @TableName varchar(255)
DECLARE TableCursor CURSOR FOR
SELECT Table_Schema+‘.‘+Table_Name FROM information_schema.tables WHERE table_type = ‘base table‘
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS = 0
BEGIN
DBCC DBREINDEX(@TableName,‘ ‘,90)
FETCH NEXT FROM TableCursor INTO @TableName
END
CLOSE TableCursor
DEALLOCATE TableCursor
标签:
原文地址:http://www.cnblogs.com/bluecs/p/4207616.html