Nothing earth shatteringly new; just for my reference:
— Get a comma separated list of a table’s column names
SELECT STUFF(
(SELECT
‘,’ + COLUMN_NAME AS [text()]
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME = ‘TableName‘
Order By Ordinal_position
FOR XML PATH(”)
), 1,1, ”)