Lets say we select from TableA that joins to TableB
TableB also gets data inserted into into it via another query.
So I guess SQL server places a shared lock on Table A and Table B.
and the insert will try and put an exclusive lock on the table.
We then get a deadlock. What I am trying to get my head around is why?
I would have thought that the Insert query would wait until the lock
was released on table B. Ok the select query does take a long time,
but I would have thought the insert would time out.
I know there is something I am missing in my logic. I am just trying
to figure out how the tables become deadlocked in this situation.
TIA |