• Thanks for that Chris....

    Right, so now I understand how a recursive CTE works. Doh! There's a certain point when I'm reading into things that my brain just gives up and I just hack and slash until stuff works :-D.

    Logically this is more or less what I'm already doing, but surprisingly it actually takes longer than my existing query, I think because I'm identifying and hiving off smaller record sets and deleting from the source table then doing a select top 1 to prime the next pass, rather than using 2 Exists checks (I started with a similar construct to your "WHERE not EXISTS" and dropped it).

    So, technically superior but the idiot seems to have the edge on performance.....