Sunday, October 2, 2011

How to unlock tables which is lock in SQL SERVER or how to Kill SPID=-2

If your tables are locked in SQL SERVER using some SSIS or SSRS or some other tools.
For unlock we need to kill process id from sql server .

if your table is locked then SPID=-2 stored in syslockinfo table .

you can't delete directly this process id (SPID=-2)
use this query and kill whatever you got from this query result.

select req_transactionUOW
from master..syslockinfo
where req_spid = -2

KILL '030C2647-E265-4860-817D-5240D9A720D8'

Thanks,
Kapil.



No comments:

Post a Comment

Share your thoughts....