Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to solve SQL Server Error 1222 i.e Unlock a SQL Server table

In the Sql Server Management Studio, to find out details of the active transaction, execute following command.

DBCC opentran()
 
You will get the detail of the active transaction, then from the SPID of the active transaction, get the detail about the SPID using following commands.

sp_who2 SPID>
sp_lock
SPID>
 
For example, if SPID is 69 then execute the command as

sp_who2 69
sp_lock
69
 
Now , you can kill that process using the following command.

KILL 69
 
I hope this helps :)


This post first appeared on Ask For Program, please read the originial post: here

Share the post

How to solve SQL Server Error 1222 i.e Unlock a SQL Server table

×

Subscribe to Ask For Program

Get updates delivered right to your inbox!

Thank you for your subscription

×