Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 1
    sp_msforeachtable (and sp_MSForEachDb) is undocumented and unsupported. You should not/avoid using it. It might skip the tables !! See this post from @AaronBertrand about a bug Microsoft won't fix --> sqlblog.org/2020/08/04/… Commented Jun 13, 2013 at 16:02
  • Worked perfectly for me after hours of beating my brains out trying to get around the FK constraints for a data export. Commented Mar 25, 2015 at 23:14
  • Running on Azure SQL V12, I get the error "Could not find stored procedure 'sp_msforeachtable'." Commented Jun 1, 2016 at 2:03
  • Doesn't work anyways :/ Commented Apr 20, 2018 at 22:59
  • You're the life saver man Commented Feb 16, 2019 at 22:14