September 1, 2011 at 8:37 am
While working to troubleshoot a blocking issue, I'm getting the following for the resource_description column of sys.dm_os_waiting_tasks:
objectlock lockPartition=0 objid=159092103 subresource=FULL dbid=11 id=lock34781ca80 mode=X associatedObjectId=159092103
I am able to get the database name from "SELECT DB_NAME(11)", but when I run either of the following while in that database I get NULL:
SELECT OBJECT_NAME(159092103);
SELECT OBJECT_NAME(159092103,11);
How can I get the object name?
Also what is the difference between objid and associatedObjectId?
__________________________________________________________________________________
SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
Persisting SQL Server Index-Usage Statistics with MERGE[/url]
Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]
October 17, 2011 at 10:05 am
OBJECT_NAME() only works in the context of the database in which the object lives. The only thing I can think of is to extract the database_id and object_id and join to master.sys.all_objects on those 2 columns to get the database name and object name if you are running this globally and not specific to a database
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply