I tried to migrate a SQL Server database by Export Data-tier Application (.bacpac
file) from an Amazon RDS instance to other, but import didn't succeed. So now I want to delete the database (which is empty), when I try to:
DROP DATABASE mydatabase;
I get the error:
Cannot drop the database 'mydatabase', because it does not exist or you do not have permission
Some context:
CONNECT
, SHOWPLAN
, VIEW DATABASE STATE
, VIEW DEFINITION
(don't know why or how is this possible).Any help is greatly appreciated!
Using the SQL Server Management Studio to drop a database Second, uncheck the Delete backup and restore history information for databases check box, check the Close existing connections check box, and click the OK button to delete the database.
If there is a planned or an unplanned outage for a Multi-AZ DB instance, Amazon RDS automatically switches to a standby replica or secondary instance in another Availability Zone. Depending on your database activity at the time of the time of the outage, failover usually lasts between 60-120 seconds.
This is the answer for an old thread but who knows, it might help someone having the same issue.
I run into the same problem, but in my case, my database was in offline mode. If the database is in offline mode, it won't allow you to drop it with the drop command. first, you should bring the database back online by running this sp and then execute the drop table command.
EXEC rdsadmin.dbo.rds_set_database_online databasename
I ran into this same issue. After trying to restore a database via SSMS using a .bacpac, it fails and leaves you with a database that you appear to not have permissions to drop.
A workaround, is to use the rdsadmin rename function to rename it to something else, which then seems to fix the permission issue and allows you to drop it.
EXEC rdsadmin.dbo.rds_modify_db_name N'<OldName>', N'<NewName>'
Then just drop the DB. Hope that helps someone else in the same predicament.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With