To list all columns from a table in MSSQL you can use the following snippet.

Sample MSSQL

SELECT * FROM sys.columns WHERE object_id = OBJECT_ID('TABLENAME') ORDER BY name ASC

If you are using Oracle, take a look at this snippet -> How to get all column names of a Table in Oracle

One thought on “How to list all columns from a table in MSSQL”

Leave a Reply