• Here are two alternatives to sp_MSforeachdb

    http://sqlblog.com/blogs/aaron_bertrand/archive/2010/12/29/a-more-reliable-and-more-flexible-sp-msforeachdb.aspx

    And then this one that I have been using:

    http://spaghettidba.com/2011/09/09/a-better-sp_msforeachdb/

    With a few samples of usage here

    http://jasonbrimhall.info/2012/07/17/a-trio-of-eachdb/

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events