Is it possible to write a statement that selects a column from a table and converts the results to a string?
Ideally I would want to have comma separated values.
select stuff(list,1,1,'') from ( select ',' + cast(col1 as varchar(16)) as [text()] from YourTable for xml path('') ) as Sub(list)
Example at SQL Fiddle.