The INFORMATION_SCHEMA.COLUMNS view will display the column names for a specific table name.
SELECT Column_Name + ', '
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Table_Name'
There are several other views, as well as the ones above, which you may find useful. These INFORMATION_SCHEMA views provide schema information for your database.
Select top 10 * from Information_Schema.tables
Select top 10 * from Information_Schema.views
Select top 10 * from Information_Schema.routines
Select top 10 * from Information_Schema.parameters
source
share