Kill database connections to SharePoint databases

Recently I have run into the situation where I was performing some maintenance work on SharePoint (backups, applying patches, you know – that kind of stuff), but the existing database connections to SharePoint were preventing me from doing my work. The way around this was to kill the remaining database connections, and here is how this can be done:

  • Open SQL Management Studio
  • Go to Management, and right click on Activity Monitor. Click on View Processes to get the list of all database connections
  • Sort by a connection to a specific SharePoint database.
  • Right click on a connection and click Kill Process.
  • Do the same for all database connections to SharePoint, and you can carry on with your SharePoint maintenance tasks