In most cases it is wise to let SQL Server automatically update statistics.

To turn on automatic updates for all statistics in a database, if not already on, execute the following statement:

USE master
EXEC sp_dboption ‘MyDatabase’, ‘ auto update statistics’, ‘true’

To turn on automatic updates for all statistics on a specific table, such as Clients, execute the following statement:

USE MyDatabase
EXEC sp_autostats Clients, ‘ON’

To manually update the statistics on specific table, such as Clients, execute the following command:

USE MyDatabase
UPDATE STATISTICS Clients

Leave a Reply

You must be logged in to post a comment.