Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RebuildAllIndex
Message
De
18/04/2005 04:05:34
 
 
À
17/04/2005 20:33:26
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Titre:
Divers
Thread ID:
01005642
Message ID:
01005691
Vues:
22
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform