April 16, 2003 at 10:44 am
How to know whether there is a lock on a table.
April 16, 2003 at 10:56 am
Is this a start?
SELECTObject_Name(syob.id)
FROMmaster.dbo.syslocks sylo WITH (NOLOCK)
JOIN
<DBName>.dbo.sysobjects syob WITH (NOLOCK)
ON sylo.id = syob.id
WHEREsyob.type = 'U'
AND sylo.dbid = (DB_ID('<DBName>'))
SJTerrill
April 16, 2003 at 11:06 am
Oops. It only works if you run it in QA from the database which you want to check for locks. If you do it from master, I end up with sp's being returned instead of tables. I wonder what I'm doing wrong?
SJTerrill
April 16, 2003 at 11:31 am
sp_lock will give you the locks. Try sp_who2 for deadlocks.
Darren
Darren
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply