How to detach a database when SQL says it is already in use

FA210170

18/12/2019

Issue
The user needs to detach a SQL database, but SQL says it is in use.
The user has stopped all known services and processes related to the database (e.g. ION Service)

Product Line
Power Monitoring Expert

Environment
SQL Management Studio

Resolution
*Warning: Irreparable database damage can occur. Databases should be backed up prior to performing this procedure.*

In SQL Management Studio start a New Query. Type sp_who and execute. This will list all active connections for all databases of the connected instance. Find the active connection for the specific database and note the SPID number.

In a new Query, type KILL SPID#

e.g.

Kill 15