SQL Server Update Statistics with FULL SCAN

31 August,2010 by Jack Vamvas

Sometimes you just need a quick method to update all statistics of every table. The script below will apply a FULL SCAN , so I wouldn't recommend that you use this as regular maintenancce task . There are other command options for sp_MSforeachtable

exec sp_MSforeachtable 
 @command1 = 'print ''Processing table ?''',
 @command2 = 'UPDATE STATISTICS ? WITH FULLSCAN' ,
 @command3 = 'print ''Processed table ?'''

Author: Jack Vamvas (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on SQL Server Update Statistics with FULL SCAN


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer