Alternative To Cursors?

  • patelmohamad (11/26/2010)


    HI,

    Avoid Cursor , Using While loop

    No insult intended but that's just not good advice. A good FAST FORWARD, READ ONLY, STATIC cursor is nothing more than a Temp Table and a While Loop. They both have the same performance and they both use nearly identical resources.

    Now, if you said "avoid RBAR", I'd be right with you. 😉

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

Viewing post 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply