This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Based on https://gist.github.com/aleksp99/2ca3401be8965f5ea72187a7baad739d | |
SELECT | |
dm_tran_locks.request_session_id AS IDSessions, | |
CASE | |
WHEN resource_type = 'object' | |
THEN OBJECT_NAME(dm_tran_locks.resource_associated_entity_id) | |
ELSE OBJECT_NAME(partitions.object_id) | |
END AS ObjectName, | |
indexes.name AS IndexName, |