Skip to main content

SQL Server query to show all user created table names in the current context database/catalog.

use <DATABASE_NAME>;

select TABLE_CATALOG as [database],
    TABLE_SCHEMA as [schema],
    TABLE_NAME as [table]
from INFORMATION_SCHEMA.TABLES
where TABLE_TYPE = 'BASE TABLE'
order by TABLE_SCHEMA,
    TABLE_NAME;