Pessimistic lock in T-SQL

前端 未结 3 610
一向
一向 2020-12-20 22:43

If i SELECT a row for updating in MS SQL Server, and want to have it locked till i either update or cancel, which option is better :-

1) Use a query hint like UPDLOC

3条回答
  •  既然无缘
    2020-12-20 23:09

    just note that despite using ROWLOCK SQL Server might choose to still take a full page lock if it deems needed.

提交回复
热议问题