How to kill a stored procedure which is in open transaction?

Posted on

Question :

I have a stored procedure which is running since four hours but it’s uncommitted. How to check if it’s running currently and kill it.

Answer :

Download SP_WhoisActive from here: http://whoisactive.com/
run it with this query: SP_whoisactive

the result will show everything running at the moment, you will be able to identify your running stored procedure.

then run: kill [session_id from query above]

the transaction will be rolled back.

Leave a Reply

Your email address will not be published. Required fields are marked *