Lesson 45. Listing All Tables In A SQL Server Database

When you work with hundreds of tables, sometimes you lose track of things. This query will help you run a table down, plus the metadata is useful for dertermining if the table is still in use.

Examples

List All Tables

USE AdventureWorks2016

SELECT
schema_name(schema_id) as schema_name,
name,
object_id,
create_date,
modify_date
FROM sys.tables
ORDER BY name

Last updated