Showing posts with label Update statistics in all databases. Show all posts
Showing posts with label Update statistics in all databases. Show all posts

Tuesday, April 13, 2010

Update statistics in all databases

Update statistics in all databases:
USE master
go
exec sp_MSforeachdb ' IF (''?'' NOT IN (''master'',''tempdb'',''model'',''msdb'',''ReportServerTempDB''))BEGIN PRINT ''Atualizando estatísticas de '' + ''?''use ? exec sp_updatestats END';