SQL Server Question: how delete works# Database - 数据库
f*e
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?
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?