• Mine isn't nearly as fancy, and it sticks a dangling comma on the end, but when I just want a quick listing of all columns in a table (say, for a select statement where they are in Ordinal Position order), I use the following (just change the <tablenamehere> to a real table name):

    DECLARE @colline varchar(4000)

    SET @colline = ''

    SELECT @colline=@colline+COLUMN_NAME + ',' FROM information_schema.columns

    WHERE TABLE_NAME = '<tablenamehere>'

    ORDER BY ORDINAL_POSITION

    SELECT @colline