Here's an option that might work better than a rCTE. This article was written from experience on a problem very similar to what you're describing.
It uses a loop, but it's a very efficient loop because it is set-based. Check it out and let me know if you have any questions. I'll try to make the author to reply :).
http://www.sqlservercentral.com/articles/set-based+loop/127670/