Marcello Miorelli
Marcello Miorelli

Reputation: 3698

is there a way to identify a query that has been cancelled?

I was running some big updates and while checking what else was running on that server, I saw an expensive query running, I then asked my friend who was running spid 91 if he could stop it, then he cancelled his query but there was no way I could see using any DMV that that was really the case.

what I could see is on the pictures below:

enter image description here

enter image description here

there is nothing there that tells me that this query has been cancelled.

is there any way, (preferably using DMVs or T-SQL) to find the processes that have been cancelled?

Upvotes: -1

Views: 1159

Answers (2)

Satyajeet padhy
Satyajeet padhy

Reputation: 1

You can see the cancelled queries in ssms query store, the square query execution are the cancelled one.

Upvotes: 0

Rachel Ambler
Rachel Ambler

Reputation: 1604

Select session_id, Command
  From sys.dm_exec_requests

Look for killed/rollback or rollback in command.

Upvotes: 1

Related Questions