Cannot detach database 'xxx because it is currently using a workaround
The database is used most of the time, if in the process of use, we have to separate the database for some other operations. Then there will be an error like the one shown below.
So how to solve this problem? In general, when we operate in the SSMS view, we will close the connected users of SQL.
But how do you do it in command-line mode? The figure below is as follows
Execute the detach database command again and OK
Summary and usage
The fundamental reason why the database cannot be separated is that there is a user connection operation. First of all, we have to kill the process if we want to terminate the user connection.
Select spid from sysprocesses dbid=db_id ('eBay market')
Kill 56-- this is the query result of the above statement
Use master
Go
Exec sp_detach_db @ dbname='E_market'
Go
Separation succeeded