select for update vs. UPDLOCK

  • I have a problem with multiple processes selecting and updating the same data and need to implement the "select for update" in a cursor, or a (HOLDLOCK, UPDLOCK, ROWLOCK) statement.

    I was wondering which one will have less performance overhead.

    My env is a very heavy OLTP, multiple processes running and updating the same data in the same time.

    Thanks a lot mj

  • Post your cursor and let's see if we can help you get rid of it because it has the biggest and worst impact both on performance and resources.

    --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 2 posts - 1 through 2 (of 2 total)

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