SQL Server Performance

updating a table but locking it

Discussion in 'General Developer Questions' started by v1rtu0s1ty, Oct 22, 2004.

  1. v1rtu0s1ty New Member

    hey guys,

    i currently have a job that runs at 10pm and updates about 5000 rows. It's a very simple update statement. What will I add in that statement so that no one will be able to even touch it or modify it?


  2. satya Moderator

  3. derrickleggett New Member

    You really can't stop people from reading a "version" of it using WITH(NOLOCK). They can't modify the rows though because they are currently being modified by you. If you need the whole table locked (not just the columns you are updating), then follow the link Satya gave you and look at table lock.


    When life gives you a lemon, fire the DBA.

Share This Page