由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - SQL Server Question: how delete works
相关主题
SQL server 2005 deadlock同事被FIRE掉了
急!各位请进:process blocked by another processHow to delete 40 millions records in a 400 millions indexed table fast?
常用SQL的误区???--新手请绕行新手请教SQL 语法问题- alias 和 join
query running long timeSQL中NOT EXIST和NOT IN有什么区别?
请问T-SQL中Group By之后怎么找到特定的record看来确实不能从程序里去删Excel Record
NOLOCK为什么不是蓝色的?数据库题紧急求助:Transact-SQL
抛砖引玉: 谈谈SQL Server locking and blocking如何让SQL 2005 CLR Trigger返回结果给Stored Procedure用?
SQL Server Replication怎么老RECOMPILE啊Think you know deadlock in SQL Server? While..., think again:
相关话题的讨论汇总
话题: delete话题: sql话题: server话题: question话题: ix
进入Database版参与讨论
1 (共1页)
f*****e
发帖数: 5177
1
Very simple question: when delete a record in SQL server, what are the locks
applied? My understanding is IX -> X. I am not sure if there is S lock
applied before IX. In another word, when delete a record, to reduce chance
of deadlock and improve performance, should I check if the record exists
first? Or should I call delete command directly and check if the affected
rows is 0?
j*****n
发帖数: 1781
2
use EXISTS and WITH (NOLOCK) hint for your checking step would be a good
practice.

locks

【在 f*****e 的大作中提到】
: Very simple question: when delete a record in SQL server, what are the locks
: applied? My understanding is IX -> X. I am not sure if there is S lock
: applied before IX. In another word, when delete a record, to reduce chance
: of deadlock and improve performance, should I check if the record exists
: first? Or should I call delete command directly and check if the affected
: rows is 0?

c*****y
发帖数: 75
3
lS 正解
1 (共1页)
进入Database版参与讨论
相关主题
Think you know deadlock in SQL Server? While..., think again:请问T-SQL中Group By之后怎么找到特定的record
what is Microsoft SQL server 's version number?NOLOCK为什么不是蓝色的?
如何用SQL语句判断一个TABLE是否存在?抛砖引玉: 谈谈SQL Server locking and blocking
How to use the SQL key word EXISTS?SQL Server Replication怎么老RECOMPILE啊
SQL server 2005 deadlock同事被FIRE掉了
急!各位请进:process blocked by another processHow to delete 40 millions records in a 400 millions indexed table fast?
常用SQL的误区???--新手请绕行新手请教SQL 语法问题- alias 和 join
query running long timeSQL中NOT EXIST和NOT IN有什么区别?
相关话题的讨论汇总
话题: delete话题: sql话题: server话题: question话题: ix