Home Forums Programming General Hierarchy without cursor/loop RE: Hierarchy without cursor/loop

  • 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/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2