use pubs go SELECT stmt FROM ( SELECT -1 AS pos, 'SELECT' AS stmt UNION ALL SELECT ORDINAL_POSITION, CHAR(9) + COL_NAME(OBJECT_ID('authors'), ORDINAL_POSITION) + CASE WHEN ORDINAL_POSITION < 4 THEN ',' ELSE '' END FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'authors' AND ORDINAL_POSITION < 5 UNION ALL SELECT 5, 'FROM authors' ) AS st ORDER BY pos