打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Userful sql
userphoto

2011.01.31

关注

ch as a constraint, default, log, rule, and stored procedure.
select * from sys.sysobjects where name like '%tx_coupons_to_registrations%' and xtype = 'P'

--Contains a row for each object that is a SQL language-defined module. Objects of type P, RF, V, TR, FN, IF, TF, R, and D have an associated SQL module.
select top 10 * from sys.sql_modules where definition like '%tx_coupons_to_registrations%'

OPTION(MAXDOP 1) at the end of SELECT statement on production. This limits process on a single CPU, and process on other CPU's would not be affected in an event of heavy process is requested. 

E.g select top 1 * from [TABLE] OPTION(MAXDOP 1)

 

There is no need to add "WITH(NOLOCK)" to all the tables. Add "set transaction isolation level read uncommitted" to the top of the sql.

 

Delete statement:

DELETE FROM TABLE

FROM TABLE t WITH(NOLOCK)

JOIN TABLE1 t1 WITH(NOLOCK) on t.id=t1.id

 

 

 
 
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
SQL Server通过条件搜索获取相关的存储过程等对象
Understanding SQL Server LOCKS on SELECT queries
Sql Server之旅——终点站 nolock引发的三级事件的一些思考
SQL Server [索引]
从数据库查询前五条记录的sql
SQL Server 2000/2005 分页SQL — 单条SQL语句
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服