I need my select to have a pattern like this:
SELECT \' \' + tbl.* + \' \' FROM table tbl;
The ideal solution wo
Try the code below:
SELECT Stuff( (SELECT N', ' + COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'YourTableName' FOR XML PATH(''),TYPE) .value('text( [1]','nvarchar(max)'),1,2,N'')