SQL: Get a list of all tables in a database

Sometimes if you use a system where you do not have a Manager at hand, perhaps only a web based query window you may find it hard to keep track of all defined tables in the system. I for one cannot remember all the tables used in for instance Dynamicweb CMS. Please note that the example query below is for Microsoft SQL server, I am not sure if it works in other SQL server environments.

Being logged in to the system as administrator you can get a SQL Query textarea like this one below. You can then enter:

SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
order by TABLE_NAME

 

The Query Editor of Dynamicweb CMS - very handy

Links

US

Leave a Reply