Stopping the Unstoppable SQL Agent
Updated: Oct 31, 2022
A client recently needed to stop and re-start their SQL Agent so that settings changes to SQL Mail would take effect and the we could send mail / alerts from the system. However when I attempted to stop the Agent has their SQL Agent it did not error out or stop.
We can see in the image below that the Agent was stuck in a limbo state “Stopping” after waiting 30 minutes to see if the agent would stop I needed to take other steps.
What worked for be and saved me from a reboot.
Start a command prompt with “Run as Administrator”
Next type queryx SQLServerAgent This should result in a screen with a PID number.
Next use the taskkill (no spaces) / f /pid xxxx where the x’s are the PID from above.