Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to kill SQL process without rolling back

I have a trigger that is suppose to send an email, recently learned it was a bad idea, and it locked a process on my database. When I killed the process it is now stuck rolling back. I understand that I can only fix this with a server restart.

Now what I am trying to resolve is that same trigger has locked another table but I have not killed that process yet. I have heard there is a way to kill a process without rolling back but I can not find any information. It is on a dev database so we are not worried about bad data. This is Transact-SQL

like image 454
Ardel Avatar asked Nov 16 '25 15:11

Ardel


1 Answers

If the process you kill is in mid transaction it will attempt to roll it back. You cannot get around it.

like image 194
Neo Avatar answered Nov 19 '25 08:11

Neo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!