Link to home
Start Free TrialLog in
Avatar of rwheeler23
rwheeler23Flag for United States of America

asked on

SQL Server 2005 record lock

I am currently have a locked record in a table called IV00101. There is some kind of lock on one record in this table. There is a part called 255A4330P001. I cannot even do a select statement against this part. If I try, the command just sits there running and the query never completes. Is there a sp I can run that will show me the lock currently on this record?
Avatar of lcohan
lcohan
Flag of Canada image

you can try sp_lock and check for all locks on the objectid for your table
SOLUTION
Avatar of lcohan
lcohan
Flag of Canada 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
fyi:
select * from IV00101(nolock) where part= '255A4330P001' 

Open in new window

should work whatever lock is on the table/row ...
Avatar of rwheeler23

ASKER

OK, I have the SPID but how do I know which one is the lock? I see about a dozen records on this table. Do any of the columns tells me where the lock is?
Rebooting the server was the only way to free up the lock. There were about 3 possible candidates. Restarting the SQL service would have accomplished the same thing.
ASKER CERTIFIED SOLUTION
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