Getting column names of the MSSQL Table

To get the column names of a table in MSSQL

SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = ‘TableName’

This is basically the MSSQL equivalent for The MySQL Command DESCRIBE TableName which displays the table details

For getting only the column names you can use following one

SELECT Column_Name + ‘,’ FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = ‘TreeDataTable’


Posted

in

by

Tags:

Comments

Leave a Reply

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