ReadUncommited 是否意味着 NoLock

发布于 2024-07-04 16:03:03 字数 215 浏览 6 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

峩卟喜欢 2024-07-11 16:03:03

我认为你可以说

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

北城孤痞 2024-07-11 16:03:03

根据 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.

青朷 2024-07-11 16:03:03

是的,他们是同一个人

Yes they are one and the same

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文