USING DBCC DBREINDEX v7.0 In an active transactional database, index maintenance is nearly always necessary at some level. While dropping and re-creating indexes/constraints is a relatively straightforward process, there is another way to accomplish the same results by using DBCC DBREINDEX. DBCC as you know is the set of Database Console Commands that SQL Server uses to validate data, pages, structures, etc. This tool can be used a number of ways. By using the DBCC DBREINDEX to rebuild your indexes, you accomplish two goals at once. 1. You can rebuild all of the indexes for a given table in one statement. 2. PRIMARY KEY or UNIQUE CONSTRAINTS are rebuilt without having to drop and re-create those constraint objects. Knowing that the authors table in the pubs database has the following two indexes, follow the different scenarios that are used to accomplish the same task. UPKCL_auidind - clustered, unique, primary key located on PRIMARY - au_id aunmind - nonclustered located on PRIMARY - au_lname, au_fname (Assume there are no Foreign Key constraints.) BEGIN TRANSACTION ALTER TABLE authors DROP CONSTRAINT UPKCL_auidind ALTER TABLE authors WITH NOCHECK ADD CONSTRAINT UPKCL_auidind PRIMARY KEY CLUSTERED (au_id) DROP INDEX authors.aunmind CREATE INDEX aunmind ON authors(au_lname, au_fname) COMMIT TRANSACTION or DBCC DBREINDEX (authors, '') The DBCC DBREINDEX statement performs the same task without the overhead of the drop and create constraints. This alone may save time and trouble. Notice that the constraint or index structures do not have to be known beforehand. You also have the option to perform index maintenance on only one index, as well as specify FILLFACTOR values. DBCC DBREINDEX ('authors', aunmind, 80) Note that if you specify the clustered index in this statement, all nonclustered indexes will be rebuilt. -------------------------------------------