HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

SQL Server Deadlock Graph - Table, Page or Row Lock?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
graphsqldeadlockpageserverrowtablelock

Problem

Is there any way to decipher if a lock in a deadlock graph is Table, Page or Row level? I have all the information I need from the graph, including the Isolation Level, (2) but I really want to know this, too.

Thanks to anyone who can help!

Solution

In the deadlock graph XML you will see something like:


  
    
      <process id="..." ... waitresource="X:..."
...


The X is the interesting bit, possible values you are interested in are:

  • RID for row id (row level locking)



  • PAG for page level lock



  • OBJECT (which may be further qualified TAB indicating a table lock)



There are a few others kinds listed in the documentation also.

Code Snippets

<deadlock-list>
  <deadlock victim="...">
    <process-list>
      <process id="..." ... waitresource="X:..."
...

Context

StackExchange Database Administrators Q#2090, answer score: 14

Revisions (0)

No revisions yet.