Rebuild indexes and update statistics

>>Script Language and Platform: Microsoft SQL Server
For each user database, rebuild the indexes and update statistics.

Instructions: Run against master, the script will use the system catalog to produce a list of databases
If you want to excluce a database add the excluded db name to the ‘not in’ list below.

There is a setting to adjust the target fillfactor, if you wish to change.

Author: Cameron Michelis

Download Script:

We hope that the information on these script pages is
valuable to you. Your use of the information contained in these pages,
however, is at your sole risk. All information on these pages is provided
“as -is”, without any warranty, whether express or implied, of its accuracy,
completeness, or fitness for a particular purpose…

Disclaimer Continued

Back to Database Journal Home

Latest Articles