• Here is some code you can work with on this.

    declare @TestTab table (ColA int, ColB Varchar(10));

    insert into @TestTab

    select 1, 'John' union all

    select 1, 'Josh' union all

    select 1, 'Bob' union all

    select 2, 'Kathy' union all

    select 2, 'Jill'

    ;

    select * from @TestTab;

    select

    ColA,

    stuff((select ', ' + ColB from @TestTab t2 where t2.ColA = t1.ColA for xml path('')),1,2,'')

    from

    @TestTab t1

    group by

    ColA;