davrose (10/18/2010)
Well..i know how recursive CTEs work 😀i am interested in the select on the rCTE.
Anyway... now it works on the real problem as well 😉
Oh, sorry!! :blush:
No offense meant! I'm not there with you, so I can just guess what skillset you have.
The outer query transforms the output of the CTE in XML format with a blank element identifier (FOR XML PATH('')).
The STUFF part just removes the first unwanted leading comma.