replacing long running cursor

  • Sanjay-940444 (10/22/2010)


    Chris, is there any any Microsoft official document which states this?

    Jeff, is there a link for what u just mentioned?

    Thanks both

    I will tell you unequivocally that Microsoft has no official document saying that updates occur in Clustered Index order. They have, however, stated that it can't be guaranteed. If that makes you nervous, then use a Cursor, While Loop, or Recursive CTE to do the job.

    Here's the link where Paul White came up with the self-checking/enforcing method (look for the word "sequence") ...

    http://www.sqlservercentral.com/Forums/Topic802558-203-4.aspx#BM980118

    ... and here's the link where Tom Thompson added a bit more bullet proofing even to that....

    http://www.sqlservercentral.com/Forums/Topic802558-203-5.aspx#BM981258

    Both methods will be included in an updated article as soon as I get the chance.

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

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