I am finding it difficult to find solution for this deadlock. The select query is taking shared lock over index I_SEM_AGENT_COMPUTER_ID_PLUS, at the same time update query updates a record (say r1) in table and then tries to update the index I_SEM_AGENT_COMPUTER_ID_PLUS (this index has columns in include clause that are updated by update query ) However select is requesting record r1 in shared mode. What can be possible solution to this? Apart from creating a new non-clustered index for select. Note: Dirty reads not allowed, READPAST can't be used as this can return no records failing purpose of select here

有帮助吗?

解决方案

Finally solved this problem, rearranged both the queries to access the resources in the same order. That solved the problem.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top