Sql Sever 2008 Select and Delete deadlock on the same index?

How come both processes are owners of a lock on the same object (T2. PK_T2)?

How come both processes are owners of a lock on the same object (T2. PK_T2)? The locks are not on the whole index.

They are key locks and will be on different keys (rows) within the index.

In your example, 233 is trying to pull the first 500 rows. 234 is trying to delete records in the same range. 234 needs an exclusive lock on the rows it deletes, so it locks down for example row 200.233 is trying to read row 200 and pauses to wait for 234 to finish its lock, and moves on to the other 300 rows.234 tries to delete more rows and 233 is blocking it by selecting them.At this point 233 is blocking 234, and 234 is also blocking 233, so it's a deadlock.

It's a row-level locking issue.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions