>I'd be careful with any of those features (FOR XML PATH, LISTAGG, etc.) over large sets of rows. FOR XML PATH is a great feature, but it doesn't perform well on large tables. So always good to test.
>
>But for tables in the range of a few thousand rows, it works great.
What would you use with large tables? CLR function?
Also, I think I heard SQL 2016 (or next version of SQL still in the works) has new function for group aggregates. I haven't installed SQL 2016 yet, so I am not sure if it's in SQL 2016 or not.
If it's not broken, fix it until it is.
My Blog