I have a couple of big stored procs that process data to a data warehouse. Sometimes they lock up the destination table and makes the reports hang. So I need to find out who locked the table and kill the process. Our DBA is kind enough to provide a query to find that informatoin:
select CASE WHEN tl.resource_type = 'OBJECT' THEN object_name(tl.resource_associated_entity_id)
WHEN tl.resource_associated_entity_id = 0 THEN 'n/a'
ELSE object_name(p.object_id) END as 'entity_name'
, tl.*
from sys.dm_tran_locks as tl
LEFT JOIN sys.partitions as p
on p.partition_id = tl.resource_associated_entity_id
where resource_type <> 'DATABASE'
I love DBAs.
Power BI Copilot AI Instructions: Helping Users Understand The Scope Of The
Data
-
Continuing my series of posts on Power BI Copilot and the type of things
you should be including in AI Instructions, today I want to talk about
helping the...
1 week ago
No comments:
Post a Comment