22,209
社区成员
发帖
与我相关
我的任务
分享
select str(request_session_id,4,0) as spid,
convert(varchar(20),db_name(resource_database_id)) as db_name,
case when resource_database_id=db_id() and resource_type='object'
then convert(char(20),object_name(resource_associated_entity_id))
else convert(char(20),resource_associated_entity_id)
end as object,
convert(varchar(12),resource_type) as resrc_type,
convert(varchar(12),request_type) as req_type,
convert(char(3),request_mode) as mode,
convert(varchar(8),request_status) as status
from sys.dm_tran_locks
order by request_session_id,3 desc