Daily Archives: February 6, 2014

Run query on multiple databases or tables sp_msforeachdb or sp_msforeachtable

I had been using sp_msforeachdb for long to search any object (table, column, Procedure, etc) on a given SQL instance. I come across similar SP sp_msforeachtable which can be used to run against all tables. Example: Advertisements

Posted in SQL, SQL Query | Tagged , , , , , , | 2 Comments