From an earlier era of this site. Left here for the record.
SQL Server list columns in table
This is one method of getting a list of all the columns in a table on SQL Server
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME=@TABLE_NAME
This site uses a single essential cookie to remember your preference. Analytics are optional and only load if you accept. See the privacy policy for details.