Q&A about the site for enthusiasts and scholars of mythology and folklore
-- Change the value of UserId below -- to avoid fetching a cached result set DECLARE @UserId int = ##UserId## select C1.object_id, stuff((select ','+C2.name from sys.all_columns as C2 where C1.object_id = C2.object_id for xml path(''), type).value('.', 'nvarchar(max)'), 1, 1, '') from sys.all_columns as C1 group by C1.object_id