Friday, February 8, 2008

Mount And Blade 1.003trainer

Reindex an entire database on SQL server

Those who work on applications running on SQL Server database is large enough to identify early on that application is one of the critical time "spent" to access the database and that the response time of each query can change substantially if the indexes are created carefully.

After creating the DB and the indices, they tend to deteriorate with time, losing performance during logon.

A practical way to restore the performance of the indices is run on each database, perhaps as a schedule of nightlife, a script like this:

 
use Database;
GO exec
sp_msforeachtable 'dbcc DBREINDEX ("?") with NO_INFOMSGS';
GO

0 comments:

Post a Comment