• Someone could explain this better than I but, at a 100,000ft view, when you put all of these queries in a single transaction, the data isn't actually written as you would think until the transaction is committed. When that happens, it's done as a single transaction from the Log file to the table. It's a tried and true method to make WHILE loops run a bit faster although it does extend the time for locks taken. Generally, such single-ton updates should be avoided.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)