Friday, September 01, 2006

First thing to do when the execution plan changes

I need to run for every database:

EXEC sp_MSforeachtable "DBCC DBREINDEX ('?')"
EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN'

No comments: