1: 2: 3: 4: 5: 6:
select *, (SELECT STUFF((SELECT ',' + Name FROM tbl_Countries where ',' + tbl_Users.AllowedCOuntries + ',' Like '%,' + cast(tbl_Countries.CountryId as varchar(20)) + ',%' FOR XML PATH('')),1,1,'')) AS CSV from tbl_Users