A lot of times we take functions like valueList for granted. When it comes to SQL Server, if we wanted to do something similar, we have to jump through a lot of hoops.
Fortunately, I stumbled upon an article covering different techniques on MS SQL 2008, 2005, and 2000.
Take a look, you won’t be disappointed.
Read more @ http://code.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=createacommadelimitedlist.
MS-SQL Tip: Creating A Comma Delimited List From a Column
September 30, 2009