DECLARE @list VARCHAR(MAX)
SELECT @list = COALESCE(@listStr+',' , '') + columnname
FROM tablename
SELECT @list
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 28, 2015, 11:22 PM EDT
Sibeesh VenuRank #27 · 42.9K reputationPosted Jun 28, 2015, 11:22 PM EDT