• SeanF-708538 (9/23/2012)


    Jeff,

    Thank you for the elegant solution I was after.

    Intrigued, I added this code into a stored procedure and compared the performance against the existing, the average over 10 runs indicates that Jeff's solution is approximately twice as fast. Nice one!

    Thank you

    Heh... twice as fast? I'm slipping up in my old age. 😛

    Thanks for the feedback, Sean.

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