4

Created this a database from a backup.

I want to delete this database because I selected the incorrect backup. When trying to delete the database I get the following error:

Failed to delete the database: [DBNAME]. ErrorCode: 400 ErrorMessage: Cannot use reserved database name '[DBNAME]' in this operation. This is an SQL database.

Steps taken to delette database:

  1. Open Azure Portal.
  2. Select Database ([DBNAME]).
  3. Click delete button.
  4. Get above mentioned error.

Error

Error

Connecting with SSMS: The Database that I want to delete is not there DB not there

  • http://stackoverflow.com/questions/285775/how-to-deal-with-sql-column-names-that-look-like-sql-keywords – ceejayoz Oct 17 '16 at 16:35
  • @ceejayoz Is that really related here? (his question implies he was using the Azure GUI) – Reaces Oct 17 '16 at 17:32
  • Have you tried deleting the database using [SSMS](https://msdn.microsoft.com/en-us/library/mt238290.aspx)? The GUI isn't always reliable and if you keep getting the error you'll either want to contact support, or try a manual deletion using SSMS. Btw if you can could you add some screenshots about your error? I'd like to see where you get this message. – Reaces Oct 17 '16 at 17:36
  • @Reaces Given the error message, it appears the GUI isn't escaping the database name, and that OP has used a reserved word as a name. Relevant, but doesn't fully answer, hence my comment. – ceejayoz Oct 17 '16 at 17:40
  • Thank you all for your replies. I am connecting to the server through SSMS, but the database that I want to delete is not there. Only my Live DB shows. I've added a screenshot. – Louwrens Potgieter Oct 18 '16 at 15:29
  • @ceejayoz I just thought it made no sense that Azure let him create a database with a reserved name, restore it, but then not delete the restored database. And indeed, the database name itself does not look like it is a likely reserved name. In stead something else is going wrong here. – Reaces Oct 18 '16 at 15:49
  • 1
    @LouwrensPotgieter I would really suggest you contact microsoft support for this. You have a database in the GUI that isn't showing up in SSMS, that shouldn't happen. – Reaces Oct 18 '16 at 15:49
  • @LouwrensPotgieter yeah you really need to raise a support request with MS, something is broken if that's not showing in SSMS. – Sam Cogan Oct 18 '16 at 15:54
  • Thank you all. Ill put in a support request to Azure. The worst of the matter is, they are charging me for this database ;) – Louwrens Potgieter Oct 19 '16 at 08:27

1 Answers1

1

It sounds like you have used a reserved word in the DB name and for some reason the deletion process in the Azure portal isn't dealing with this. A couple of ways to deal with the immediate issue:

  • Delete the database through SQL Server Management Studio (SSMS)
  • Use SSMS to rename the database to something without a reserved word and then delete it through the portal

I would also suggest raising an bug with MS as the portal should either handle this, or prevent you from creating the DB in the first place.

Sam Cogan
  • 38,158
  • 6
  • 77
  • 113
  • +1, I should have put that in an answer myself :) – Reaces Oct 18 '16 at 15:49
  • Hi - i have the same problem (im using SSMS by default) - however the problem database is not listed under the database server's node in SSMS – yarg Dec 21 '16 at 09:09