Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RebuildAllIndex
Message
From
18/04/2005 04:05:34
 
 
To
17/04/2005 20:33:26
General information
Forum:
Microsoft SQL Server
Category:
Database management
Title:
Miscellaneous
Thread ID:
01005642
Message ID:
01005691
Views:
21
This message has been marked as the solution to the initial question of the thread.
>hi
>Im looking for a Scripts that reindex all table on a database. I found some links but its a broken links. http://www.mssqlcity.com/Scripts/Maint/RebuildAllIndexes.sql do you have url for this script? or alternative? tnx

I don't known RebuildAllIndexes, but this is sufficient for me.
USE Northwind
DECLARE tables CURSOR FOR
 SELECT 
    dbOwnTable = DB_NAME()+'.'+USER_NAME( uid )+'.'+Name 
    FROM sysobjects WHERE type='U'
OPEN tables

DECLARE @dbOwnTable varchar(400)

FETCH NEXT FROM tables INTO @dbOwnTable

WHILE @@FETCH_STATUS = 0
BEGIN
   DBCC DBREINDEX (@dbOwnTable)  -- WITH NO_INFOMSGS
   FETCH NEXT FROM tables INTO @dbOwnTable
END

CLOSE tables
DEALLOCATE tables
GO
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform