• Lynn Pettis (11/27/2008)


    And two, someone is going to come along and see your code in your RBAR TVF and use it somewhere else and it won't be effecient at all.

    Heh... job security for him... if he keeps planting timebombs like this, the customer is sure to call back for more "professional tuning services". 😛

    If you take the time to write solid, efficient, and scalable code all the time you don't have to worry about those two things occuring as much.

    If you compare the code, which takes longer to write? The cross join method or the WHILE loop? Nah... like I said before, it takes no extra time to do it right the first time.

    --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)