• If you can use the SQLCLR here is an Aggregate Function I wrote to simplify the syntax for these types of queries that performs comparably (sometimes better, sometimes slightly worse) than the XML method you were shown.

    GROUP_CONCAT string aggregate for SQL Server[/url]

    Here is what your query might look like:

    SELECT POPRCTNM,

    dbo.GROUP_CONCAT(CAST(ACTINDX AS VARCHAR)) AS AliasForStuff

    FROM POP30390 d1

    GROUP BY POPRCTNM;

    If you wanted a duplicate-free list just add DISTINCT into the Aggregate:

    SELECT POPRCTNM,

    dbo.GROUP_CONCAT(DISTINCT CAST(ACTINDX AS VARCHAR)) AS AliasForStuff

    FROM POP30390 d1

    GROUP BY POPRCTNM;

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato