We can get a comma delimited output from a single select statement in SQL Server by using the following SQL Script.


select  stuff(( select  ',' + CountryRegionCode
                from    Person.CountryRegion
              for
                xml path('')
              ), 1, 1, '') as CodeList