Get Table information (Column Name, Data Type) 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

9 comments

Leave a comment

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

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