I’m using the sys.dm_tran_locks view to check what areas of my database have locks when we are having performance problems.
Using this view….
-
If the resource_type is database I can use the DB_NAME function to find out what database has the lock.
-
If its an object I can normally join to sys.tables to check what table it is.
However if the resource_type is Page or Key is there any way to trace this back to its parent table so I can get a good idea of which tables are locking?
This is what the
resource_associated_entity_idcolumn is for (Example query).