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