首页 > 解决方案 > SQL Server Cancel Execution in SSMS vs Kill (SPID)

问题描述

What is the difference between cancel execution in SSMS and using kill(spid). In testing, I've discovered that when you cancel an execution, using kill (spid) with statusonly returns the error that the rollback operation is not in progress.

It's probably applicable to all recent versions of SQL Server, but in my case I'm using 2017. SSMS is V18.

标签: sql-serverssms

解决方案


KILL will rollback a transaction, cancelling the execution of a command will stop the query at the soonest opportunity and will not automatically roll it back.


推荐阅读