Database Reference
In-Depth Information
3.
Choose the Steps page, click New, and enter the SQL command for the user database, as
shown in Figure 12-40 . This is a short method for ensuring all statistics are updated across
all tables in a database. It's not very precise, and it could create a large load depending on
the size of your system, so be sure this is what you need on your system before running it.
EXEC sys.sp_MSforeachtable
'UPDATE STATISTICS ? ALL WITH FULLSCAN';
Figure 12-40. Entering the SQL command for the user database
4.
Return to the New Job dialog box by clicking the OK button.
5.
On the Schedules page of the New Job dialog box, click New Schedule, and enter an
appropriate schedule to run the SQL Server job. Return to the New Job dialog box by
clicking the OK button.
6.
Once you've entered all the information, click OK in the New Job dialog box to create the
SQL Server job.
7.
Ensure that SQL Server Agent is running so that the SQL Server job is run automatically at
the set schedule.
Another approach to statistics maintenance would be run one of the scripts developed and maintained by Ola
Holengren ( http://bit.ly/JijaNI ) .
Search WWH ::




Custom Search