Wednesday, 15 May 2013

sql - If I KILL(SPID), what happen the running transaction? -


I have a process, currently running on an SPID. Now, I found out that the query is running very slow. Update / insert this in the receipt if I kill the session, what will happen?

SQL Server will stop executing the query and any open transactions. That rollback will undo all the changes that are not fully committed. Since SQL Server adheres to the principle, you should not be able to leave your database in bad condition, even by killing SPIDs. It is not that you can not leave your data in bad state, that is, by applying continuity of failure to wrap up many actions in a transaction.


No comments:

Post a Comment