Posts Tagged ‘Comma’

h1

COALESCE – To Get Comma Separated List SQL SERVER

12/29/2008

Today in one report, i need to display the comma seprated data from table. So use the COALEASE feature and will share with you all.

You can use it like:

DECLARE @result VARCHAR(MAX)
SELECT @result = COALESCE(@result + ', ', '') + TestTejas.ColumnName
FROM
TestTejas

SELECT @result