How to stop a run-away SQL transaction

The Problem: Recently was testing my web-app against a SQL-Server 2008 database and got a time-out expired message from the SQL database. No matter what I did after that it just did not want to drop the transaction and I continually got the time-out. I needed to find and stop the SQL transaction.


The solution: Sign onto the SQL-Server with the Enterprise Manager.

Execute sp_who2

and look for rows that are blocked on another connection (the BlkBy column will have the spid of the blocking connection in it).

Now kill the culprit:

kill xx

(xx = spid).

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted @ Thursday, July 02, 2009 11:05 AM

Comments on this entry:

No comments posted yet.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 
Twitter