SELECT a3.text,DB_NAME(resource_database_id),
CASE WHEN resource_type=‘OBJECT‘ THEN OBJECT_NAME(resource_associated_entity_id) ELSE ‘‘ END
, * FROM sys.dm_tran_locks a1
LEFT JOIN sys.dm_exec_connections a2 ON a1.request_session_id=a2.session_id
CROSS APPLY sys.dm_exec_sql_text(a2.most_recent_sql_handle) a3
时间: 2024-10-05 05:04:46