When you delete a database from www.2cto.comdatabase201210160122.html, the system prompts that the database is in use and cannot be deleted (Cannotdropdatabasedatabasenamebecauseitiscurrentlyinuse
When the http://www.2cto.com/database/201210/160122.html deletes a database, it prompts that the database is in use and that the problem (Cannot drop database databasename because it is currently in use) could not be deleted when it prompts that the database is in use, unable to delete (Cannot drop database databasename
Http://www.2cto.com/database/201210/160122.html
When deleting the database, the system prompts that the database is in use and Cannot be deleted (Cannot drop database databasename because it is currently in use ).
When deleting the database, the system prompts that the database is in use and Cannot be deleted (Cannot drop database databasename because it is currently in use)
This is because a problem occurs during database operations. For example, after connecting to the database, the database connection is enabled,
If it is not properly closed after use, this situation may occur.
Now we provide a solution: www.2cto.com
Use master
Go
Alter database database_name set single_user with rollback immediate
-- Roll back the database to the original configuration status
Go
Drop database database_name -- delete a database
Go
Note: database_name indicates the name of the database to be deleted.
I use sqlserver2008 to solve the problem.