I'm not sure why this works because no cursor is involved, but hey, I'm not going to complain...
declare @csvstring nvarchar(3000)
set @csvstring =''
select @csvstring =Coalesce(@csvstring + ',', '') + columnname from tb_whatever where id=12345
select @csvstring
It has a prepended comma, but that's easy enough to take off.