The system prompts that the database is in use and cannot be deleted (Cannotdropdatab

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.