Question

I ran the following query and my records are locked now I can't read or update or delete. For testing purpose i didn't called commit tran and now these records got stuck. How can I release these locks which are already placed.

  BEGIN TRAN

  SELECT * from inquiry with (XLOCK,READPAST)  where inquiry_id=228563
Was it helpful?

Solution

You should find you lock process id by sys.dm_tran_locks and kill it manually

SELECT * FROM sys.dm_tran_locks WHERE RESOURCE_TYPE = ‘OBJECT’

and then use KILL with id number

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top