• thomashohner (5/4/2014)


    I did a Google search and yes the Recursive CTE does seem to have a HUGE performace disadvantage compared to a Loop. I'm still very new at this so my next question to research and understand is why.

    It'll probably be faster than an explicit loop. Slower than a proper set-based operation. That's because behind the scenes it is a loop.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass