• Lowell (7/14/2010)


    turning the related rows into a comma delimited list is what you are after right?

    the easiest way is to use a neat trick using FOR XML.

    here's a nice example I keep handy in my snippets that i think is very intuitive.

    Cool, haven't come across this before. Much easier than the CTE I went with.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/