WinTill :: Knowledge Base



Reindex Database Tables

During rebuilding a clustered index, an exclusive table lock is put on the table, preventing any table access by your users. During rebuilding a nonclustered index, a shared table lock is put on the table, preventing all but SELECT operations to be performed on it.

N.B. You should schedule DBCC DBREINDEX statement during CPU idle time and slow production periods.

This script rebuilds all indexes with a fillfactor of 80 in every table in the database:

USE
GO
EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)"
GO
EXEC sp_updatestats
GO




Related Articles

Attachments

No attachments were found.

Visitor Comments

Article Details

Last Updated
7th of March, 2011

Would you like to...

Print this page  Print this page

Email this page  Email this page

Post a comment  Post a comment

 Subscribe me

Subscribe me  Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF


User Opinions

No users have voted.

How would you rate this answer?




Thank you for rating this answer.

Continue