Once in a while we need to return data from SQL as delimited string of values and not as rows. There are several ways to do that, but personally i like the next one.
SQL 2005 – Return query rows as one delimited column
kossovsky.net