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

Posted

in

by

Tags:


Related Posts

Comments

9 responses to “Get Table information (Column Name, Data Type) in SQL Server”

  1. Mahmad Khoja Avatar
    Mahmad Khoja

    Thanks this helped me lot to generate property based on table name.

  2. Michael Hansip Avatar
    Michael Hansip

    nice sharing, thank you.

  3. amy Avatar
    amy

    thank you! this helped me out a bunch! now I can figure out my tables easier

  4. ASHITHA Avatar
    ASHITHA

    GOODD SHARING….HELPED ME ALOT..

  5. thilak Avatar
    thilak

    really nice one thank you

  6. henry Avatar
    henry

    Yes. see this url more details i.e. http://belearnings.com/blogs/

  7. Ryan Davis Avatar
    Ryan Davis

    very clear, helpful answer to my issue…thanks!

  8. gurmukh6849 Avatar

    thanks for this information

  9. dattatraya rathi Avatar
    dattatraya rathi

    thank you for a query

Leave a Reply

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

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading