Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RebuildAllIndex
Message
 
 
To
18/04/2005 04:05:34
General information
Forum:
Microsoft SQL Server
Category:
Database management
Title:
Miscellaneous
Thread ID:
01005642
Message ID:
01005726
Views:
23
Here's shorter one
USE Northwind
EXEC sp_MSforeachtable @command1="DBCC DBREINDEX ('?')"
>>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
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform