DECLARE @tblName VARCHAR(50)
DECLARE rs CURSOR FOR
SELECT TABLE_NAME FROM information_schema.tables WHERE [TABLE_TYPE] =N’BASE TABLE’
OPEN rs
FETCH NEXT FROM rs INTO @tblName
WHILE @@FETCH_STATUS = 0
BEGIN
DBCC DBREINDEX( @tblName,”,90)
END
CLOSE rs
DEALLOCATE rs
Rebuild Index, Script, sql server
This entry was posted
on Friday, March 12th, 2010 at 8:48 am and is filed under Database, MS SQL Server, SQL Server 2008.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.