The system tables in Sql Server

We can use the sys.tables and sys.objects to find metadata of tables and columns.

Display all User Tables

select * from sys.tables – displays all user tables

Display all Columns in a Table

select * from sys.columns where object_id in
(select object_id from sys.tables where name=’MyTable)

Leave a Reply

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