SQL SERVER – Script to Kill All Inactive Sessions – Kill Sleeping Sessions from sp_who2

I consider myself fortunate that I get to work with so many different clients while engaged in Comprehensive Database Performance Health Check. Recently we found out that one of the third party application for the client is not closing the connections which they open after completing the transactions. This was negatively affecting their performance. We immediately opened the ticket with the third party application and while they provide the solution after patching the application we decided to kill all the inactive sessions.

Read More

SQL SERVER – How to Kill All the Processes for Any Database?

Recently during Comprehensive Database Performance Health Check, to test our unique fix, we had to run a stress test on my customer’s development environment. Once we were done testing our script, we did not need our stress test queries to run on our server. Even though we stopped to run the batch file with stress test queries, there were few long-running queries kept on running on the server. This brought us to a very interesting point where we had to kill all the processes for one particular database.

Read More