When I query sys.dm_tran_locks, a couple of questions arise:
I can see there are some locks that are placed at KEY, PAGE, EXTENT, RID level (
resource_typecolumn). How to find out to which table or object these particular keys, pages, extents, rids belong to?For the OBJECT level locks (
resource_type = 'OBJECT') - what is the proper way to define object name? Is theresource_associated_entity_idcolumn theobject_idof the object? Or is there some caveat?Some OBJECTS have
resource_associated_entity_id = -1261057897(negative number) - how to find out the object name for these?