• Dennis Wagner-347763 (3/6/2014)


    The correlated subquery may be executed many times. It will be run once for each candidate row selected in the outer query.

    I believe that Jeff Moden refers to this as RBAR (row by agonizing row).

    Except that correlated subqueries *don't* run once per row of the outer query. It's an old and persistent myth that they do that.

    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