STUFF((SELECT ', '+ Column1 FROM Table1 FOR XML PATH('')),1,1,'') AS ConcatenatedColumn
StudentName
-------------
Mary
John
Sam
Alaina
Edward
Result: Mary, John, Sam, Alaina, Edward
STUFF((SELECT ', '+ Column1 FROM Table1 FOR XML PATH('')),1,1,'') AS ConcatenatedColumn
StudentName
-------------
Mary
John
Sam
Alaina
Edward
Result: Mary, John, Sam, Alaina, Edward