• Eddie Wuerch (9/10/2013)


    Weird that it's deadlocking on a page. Since you have the page address (5:1:1662692), it would be nice to see what the actual deadlocked resource is.

    Print the page header with the following code, and report back what you see for the following values:

    m_type

    Metadata: IndexID

    Here's the code:

    DBCC TRACEON(3604);

    DBCC PAGE(5, 1, 1662692);

    I believe it is doing a page lock because of the isolation level. From BOL on Serializable:

    Range locks are placed in the range of key values that match the search conditions of each statement executed in a transaction. This blocks other transactions from updating or inserting any rows that would qualify for any of the statements executed by the current transaction. This means that if any of the statements in a transaction are executed a second time, they will read the same set of rows. The range locks are held until the transaction completes. This is the most restrictive of the isolation levels because it locks entire ranges of keys and holds the locks until the transaction completes. Because concurrency is lower, use this option only when necessary. This option has the same effect as setting HOLDLOCK on all tables in all SELECT statements in a transaction.

    This doesn't look to me like a situation where SERIALIZABLE would be necessary. I would think that READ COMMITTED would be appropriate for this type of insert.