SQL Server 2005/2008上的默认表锁定提示 [英] Default table lock hint on SQL Server 2005/2008

查看:98
本文介绍了SQL Server 2005/2008上的默认表锁定提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您如何查找默认的全局表锁定提示?

How do you look up a default global table locking hint?

-问题

  1. 是否有返回此类信息的DMV/DMF(动态管理视图/功能)?
  2. 而且,有没有办法更改默认锁定提示?
  1. Are there any DMV/DMF (Dynamic Management View/Function) that return such information?
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆