declare @test table( name varchar(10))
insert into @test values('a')
insert into @test values('b')
insert into @test values('c')
insert into @test values('d')
SELECT * FROM @test
select distinct
(select cast(name AS varchar(2))+','from @test for xml path(''))as name from @test
SELECT * FROM @test FOR XML PATH('name')