NOLOCK vs. Transaction Isolation Level

后端 未结 4 1671
南旧
南旧 2020-12-09 16:44

What\'s the difference between using \"SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED\" and NOLOCK? Is one better than the other?

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 17:14

    They have the same effect, only one is used as a lock hint (nolock) and the other is used for a connection scope.

    Be careful with either of those - dirty reads can be a very bad thing depending on your app. Reading the same record twice or missing a record because of page movement can be a very confusing thing to users...

提交回复
热议问题