List All Tables in All Databases in SQL Server

Recently I had to examine the content of almost all tables in all databases to find necessary tables and recreate the entity model. So I need a script that can iterate thru all tables in all databases on a given server.

This can be made with the help of undocumented stored procedure sp_msforeachdb. The examples of use can be found via Google search.Here is my script that lists all tables on a MS SQL server.

Leave a Reply

Your email address will not be published. Required fields are marked *