• J Livingston SQL (4/18/2014)


    Sean Lange (4/18/2014)


    J Livingston SQL (4/18/2014)


    quick Google....heres an article that may help

    http://davidduffett.net/post/5334646215/get-a-comma-separated-list-of-values-in-sql-with-for

    JLS, I can't get that link to load. It just spins and spins. From the url is it using FOR XML like the example already posted here or is there another approach being used. I am curious because using FOR XML to generate a comma separated list is the easiest and fastest way I know of.

    odd...worked earlier...all I get now is spins as well ???...all it was an explanation of how XML path works in easy steps.....which the OP could find via googlefoo 😀

    It wasn't a better method.

    Ahh gotcha.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/