ReadUncommited 是否意味着 NoLock
在 SQL Server 2005 中编写 SQL 语句时,READUNCOMMITTED 查询提示是否暗示 NOLOCK 还是我也必须手动指定它?
也是:
With (NoLock, ReadUnCommitted)
与: 相同
With (ReadUnCommitted)
When writing a SQL statement in SQL Server 2005, does the READUNCOMMITTED query hint imply NOLOCK or do I have to specify it manually too?
So is:
With (NoLock, ReadUnCommitted)
the same as:
With (ReadUnCommitted)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你可以说
ReadUnCommited具有NoLock的能力
但是你不能说
NoLock具有ReadUnCommited的能力
I think you can say that
ReadUnCommitted has the abilities of NoLock
However you cannot say that
NoLock has the abilities of ReadUnCommitted
根据 Kalen Delaney 的说法...
NOLOCK 提示与索引选项无关。 提示告诉 SQL
服务器在做SELECT操作时不会请求锁,所以会出现
与已锁定的数据不冲突。 索引选项只是告诉
SQL Server 允许在锁定时允许此级别的锁定
发生。 例如,如果 ALLOW_ROW_LOCKS 关闭,则唯一可能的锁
将是页锁或表锁。 索引选项不会强制锁定
举行,他们只是控制锁的可能大小。
在回答您的主题中的问题时,NOLOCK 提示和
READUNCOMMITTED 提示是等效的。
According to Kalen Delaney...
The NOLOCK hint has nothing to do with the index options. The hint tells SQL
Server not to request locks when doing SELECT operations, so there will be
no conflict with data that is already locked. The index options just tell
SQL Server that this level of locking is allowed, when locking is going to
occur. For example, if ALLOW_ROW_LOCKS was off, the only possible locks
would be page or table locks. The index options don't force locks to be
held, they just control the possible size of the locks.
In answer to the question in your subject, the NOLOCK hint and the
READUNCOMMITTED hint are equivalent.
是的,他们是同一个人
Yes they are one and the same