SQL Server database cannot be deleted

Source: Internet
Author: User

Today to help test students to solve the database can not delete the problem, the process is as follows:

1, delete the database is, the database into single-user mode, and can not be deleted, such as:

650) this.width=650; "title=" 1.png "alt=" wkiol1qbvzsg5tmfaaa9iihiksg014.jpg "src=" http://s3.51cto.com/wyfs02/M00/ 49/d6/wkiol1qbvzsg5tmfaaa9iihiksg014.jpg "/>

2. View database Connection Status

650) this.width=650; "title=" 2.png "alt=" wkiol1qbv4wxpkawaafnyig54xa593.jpg "src=" http://s3.51cto.com/wyfs02/M01/ 49/d6/wkiol1qbv4wxpkawaafnyig54xa593.jpg "/>

View the database connection to see that the database is being used by the application user.

3. Kill connection

Execute directly on the SQL command line:

Kill spid;

Connection can be deleted, if the program has a reconnection mechanism, it is best to first stop the application, and the application of the user lock, no one will continue to connect.

4, repair the database for Multi_user mode

ALTER DATABASE sb_game set Multi_user;

5, after repair, delete database prompt database configured replication

Then you need to delete the corresponding replication-related configuration, and then delete the database just fine.

Report:

This case tells us to stop the database or delete the database, we should first stop the application, disconnect all connections, check whether there is an application connection, there is a similar image, replication related functions, and then delete the database operation.

This article is from the "composer" blog, make sure to keep this source http://zuoqujia.blog.51cto.com/9151800/1555120

SQL Server database cannot be deleted

Related Article

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.