SELECT FOR UPDATE with SQL Server

后端 未结 18 2263
自闭症患者
自闭症患者 2020-11-27 11:49

I\'m using a Microsoft SQL Server 2005 database with isolation level READ_COMMITTED and READ_COMMITTED_SNAPSHOT=ON.

Now I want to use:

18条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 12:25

    Try using:

    SELECT * FROM  WITH ROWLOCK XLOCK HOLDLOCK
    

    This should make the lock exclusive and hold it for the duration of the transaction.

提交回复
热议问题