SQL Server: View all columns of a table

This query lets select the 0th row, over here it seems to be the column names row.Change the table name to your name of choice.

select top 0 * from table_name

The below query uses the system objects to select the columns from the system objects.

SELECT name FROM sys.columns WHERE OBJECT_ID IN (SELECT OBJECT_ID (table_name))

Leave a Reply

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