Link to home
Start Free TrialLog in
Avatar of LJG
LJG

asked on

How to get an ObjId if you have an SPID - Stored Procedure

SQL Server 2000
I am working with detecting (in the future) an object name in a proc.

I'm working to have a proc that I can run and find the table that is locked.  I can run:

execute sp_Lock @vcSPID  
         where @vcSPID = the SPID from the locked process

Inside the table created by sp_Lock (in my case 13 records) I have an objId that equals = 0 on record 1 and the objId of the locked object in the field ObjId on the other records.  

I want to put that ObjId in a variable that I can use later SELECT object_name(@intObjId) .

Thanks in advance for any help.
LJG
I want to put
ASKER CERTIFIED SOLUTION
Avatar of Lara F
Lara F
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial