Category Archives: sp_updatestats for all user databases

Update Statistics for all the databases


USE master
go

exec sp_MSforeachdb
 
‘ IF (”?” NOT IN (”master”,”tempdb”,”model”,”msdb”,”ReportServerTempDB”))

BEGIN
PRINT ”Updating Statistics” + ”?”
use ?
exec sp_updatestats
END’;