This is a really cheap way of only doing it to some databases; just add the list in two single-quotes (since you're running it within sp_MSforeachDB)
sp_MSforeachdb 'if ''?'' NOT IN (''tempdb'')
begin
use ?
exec sp_updatestats
end'
Put butter in your mixer, add sugar, set on low. Write a stored procedure to keep track of jobs that won't run. Add flour. Use a DMV to find unused indexes. Add eggs. Bake in an MDF with 20% free space.
sp_MSforeachdb 'if ''?'' NOT IN (''tempdb'')
begin
use ?
exec sp_updatestats
end'
No comments:
Post a Comment