How to exclusively lock a row that prevent CRUD operation

前端 未结 5 1804
無奈伤痛
無奈伤痛 2021-01-11 15:56

Hi expert how I can lock a row in sql server that prevent CRUD operation even SELECT. Is it Possible? Serializable Isolation level does not prevent SELECT. thanks

5条回答
  •  一生所求
    2021-01-11 16:31

    It's possible to lock a row using a locking hint WITH (ROWLOCK), however a SELECT statement can always get around it by adding a locking hint WITH (NOLOCK) which will provide a dirty read.

提交回复
热议问题