Home Forums SQL Server 2008 T-SQL (SS2K8) Cycle Through Multiple db's For EXISTence of a Table then DELETE RE: Cycle Through Multiple db's For EXISTence of a Table then DELETE

  • Sean Lange (5/4/2016)


    Be careful using sp_msforeachdb. It can sometimes skip databases. Even more shocking is many of the major players don't really know why. http://sqlblog.com/blogs/aaron_bertrand/archive/2010/12/29/a-more-reliable-and-more-flexible-sp-msforeachdb.aspx

    Thanks for the tip! I've never had any issues personally but it's always good to know about some possible caveats.


    SELECT quote FROM brain WHERE original = 1
    0 rows returned