Get Table information (Column Name, Data Type) in SQL Server

Author posted by Jitendra on Posted on under category Categories SQL Server and tagged as Tags with 7 Comments on Get Table information (Column Name, Data Type) in SQL Server

Get Table information like Column Name, Data Type, Character length, Default Values etc in SQL Server

To get the Table in information in SQL Server,  we can use below Query:

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Users'
ORDER BY ORDINAL_POSITION

Where’ Users’ is Table Name
Output is shown in below snap:

SQL Server INFORMATION_SCHEMA.COLUMNS
SQL Server INFORMATION_SCHEMA.COLUMNS

We can use below query also:

sp_Columns 'Users'

Output is shown in below image:

sp_Columns SQL Server
sp_Columns SQL Server

Related posts

7 thoughts on “Get Table information (Column Name, Data Type) in SQL Server”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.