Skip to content

Instantly share code, notes, and snippets.

View flakey-bit's full-sized avatar

Eddie Stanley flakey-bit

  • Xero
  • Vancouver, Canada
View GitHub Profile
@flakey-bit
flakey-bit / sqlserver_locks.sql
Created March 25, 2024 21:52 — forked from aleksp99/tran_locks.sql
tran_locks.sql
-- 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,