Try this, SELECT DISTINCT id, STUFF((SELECT ','+ CONVERT(VARCHAR(30), Column2) FROM table1 AS S2 WHERE S1.id = S2.id FOR XML PATH('')), 1, 1, '') AS Column_HoldingCommavalues FROM table1 AS S1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)