SQL Server 2005/2008上的默认表锁定提示 [英] Default table lock hint on SQL Server 2005/2008
问题描述
您如何查找默认的全局表锁定提示?
How do you look up a default global table locking hint?
-问题
- 是否有返回此类信息的DMV/DMF(动态管理视图/功能)?
- 而且,有没有办法更改默认锁定提示?
- Are there any DMV/DMF (Dynamic Management View/Function) that return such information?
- And also, is there a way to change the default lock hint?
目前,我几乎在所有地方都添加了nolock
提示,以防止锁定.
我想通过将默认的锁定提示更改为nolock
来避免这样做,从而无需更改现有的存储过程.
Currently I am adding nolock
hint almost everywhere to prevent locks.
I'd like to avoid doing so by changing the default lock hint to nolock
so that existing stored procedures do not need to change.
推荐答案
我不知道任何此类全局设置.恕我直言,即使存在,使用它的理由也很少.
I am not aware of any such global setting. IMHO even should that exist there can be little justification for using it.
但是,您可以设置隔离级别来控制单个事务是否能够读取其他事务对数据所做的更改.这是通过
You can however set the isolation levels to control whether individual transactions are able to read changes to data made by other transactions. This is done via
SET TRANSACTION ISOLATION LEVEL
这篇关于SQL Server 2005/2008上的默认表锁定提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!