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 | |
|