I received following question in email :
How to create a comma delimited list using SELECT clause from table column?
Answer is to run following script.
DECLARE @listStr VARCHAR(MAX)
SELECT @listStr = COALESCE(@listStr+',' ,'') + Name
I have previously written similar article where I have demonstrated this method using three sample examples. You can read the article for further information. SQL SERVER – Creating Comma Separate Values List from Table – UDF – SP
Reference : Pinal Dave (http://blog.SQLAuthority.com)