This week I am going to tell you a story. A story of a friend of mine who always come up with thing or two and help me find a topic for a blog post. Earlier last week, he had one more issue, while he was performing some changes to his production server. It needs a restart of SQL Server. And, his bad luck strike again. Just like he do every time. He call me. The issue was the SQL Server service hung in stopping mode.
Fixing the issue, SQL Server service hung in stopping mode
Option 1: Do a quick reboot of a server and it will be back to normal
Option 2: Take another approach
My friend was not lucky enough, he doesn’t have luxury to reboot the server. Basically, the server is hosting an IIS as well. So, he was left with only option 2. And, that was killing the service using Windows Command called SC.
Here is how the issue was fixed
- Open the command prompt
- Run SC QueryEx <SQL Service Name>
- Get PID for offending service or instance name
- run taskkill /PID <PID#> /f
This has kill the Process ID/SQL Server process that my friend having an issue with and this is how we have fixed SQL Server service in stopping mode.