Reindex all tables in a database (2000 & 2005)
exec sp_MSforeachtable "DBCC DBREINDEX ('?')"
or
EXEC sp_MSforeachtable "print '?' DBCC DBREINDEX ('?', ' ', 85)"
Update statistics in a database
For 2000 (since sp_updatestats can break certain things)
EXEC sp_MSforeachtable "update STATISTICS ?"
For 2005:
sp_updatestats
No comments:
Post a Comment