Home Forums SQL Server 2008 T-SQL (SS2K8) Query Help- Cursor change into FOR WHILE LOOP, TEMP TABLE RE: Query Help- Cursor change into FOR WHILE LOOP, TEMP TABLE

  • morepainot (7/26/2012)


    The reason for the WHILE LOOP is because with CURSOR it is much slower than with WHILE LOOP.

    Like I said, that's patently and absolutely not true. The WHILE LOOP is usually what makes cursor usage so slow and I've proven that many times for companies that think other wise.

    The key to performance here is to get rid of the WHILE loop. Period.

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