1> drop database 2> go Msg 3702, Level 16, State 4: Server '', Line 1: Cannot drop the database '' because it is currently in use. This message is returned if the command is successful. 环境 DROP DATABASE "provabss" ERROR: DROP DATABASE: cannot be executed on the currently open database. The initializer cannot drop the database because there is currently an open connection. In statement: DROP DATABASE "provabss"---I don't have any problems if i do this inside a sql window (of phpPgAdmin) with a "DROP DATABASE provabss". It would be hugely helpful to add some info on what a user should do when he tries to delete a currently open database. Click OK to create the login and its role. Then, change the user's default database to a database that's currently available for a connection. Make sure the database is highlighted in the dialog box, then, under the Database role membership for: , check the db_owner role. 解决方案 This does not work, it tells me "Cannot drop database "ima_debts" because it is currently in use". To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation. Database encryption needs to be turned off to be able to drop the database encryption key. Not even "Microsoft SQL Server Management Studio (Administrator)" is connected to it. WARNING: redis-trib.rb is not longer available! We must switch to another database or template1 if we want to delete the database we are currently connected to. I'm getting the following error: ***** SQL error: ERROR: cannot drop the currently open database In statement: DROP DATABASE "test" ***** on any db I'm trying to drop. The big-hammer approach is: I don't have any problems if i do this inside a sql Use ALTER TABLE to drop a constraint default. DROP DATABASE: cannot be executed on the currently open database You cannot be connected to the database you are about to remove. You have to remove it, if your database … "DROP DATABASE provabss". Connect to SQL Server Management Studio; expand Database Node -> Right click the Databases which you want to Drop -> Select Delete from the drop-down menu to open up Delete Object dialog box as shown in the snippet below. Cannot drop the currently open database. cannot drop database because currently its in use. You cannot delete the database that is involved in the log shipping. Autocommit mode is the default transaction management mode.You cannot drop a database currently being used. One way to remove users from the database is to use ALTER DATABASE to set the database to SINGLE_USER. probabilities := []int{300, 1000, 2400, 1600, 3000, 1200, 500}, 目录 回复 The database principal owns a schema in the database, and cannot be dropped. I have made sure to login to "master". 2. If the database is encrypted, you must first remove encryption from the database by using the ALTER DATABASE statement. In addition, you cannot execute the DROP DATABASE statement if the database still has active connections. System databases cannot be dropped.The DROP DATABASE statement must run in autocommit mode and is not allowed in an explicit or implicit transaction. The following commands will raise above error: 症状 Previous Previous post: Cannot drop a default constraint by DROP DEFAULT statement. When user drop the SQL Server database, then it cannot be retrieved without the backup. PostgreSQL also