Welcome!

Apache Authors: RealWire News Distribution, Alfredo Diaz, Lev Lesokhin, Bob Gourley, Dmitry Sotnikov

Blog Feed Post

Azure CLI Day 55 – sql db delete

bash-azure

In my three previous posts I showed you how to use the Windows Azure cross platform tools to do the following:

In this post I’ll show you how to use the tools to delete a SQL database.

Once again, just a reminder that I’m using the command line tools on a MacBook Air with OSX (Mavericks) installed, and I’m using Google Chrome as my default browser. However, the experience should be identical on Windows and Linux as well.

Open an instance of your command line (Terminal, Bash, Command Prompt, etc.) and type the following:

azure sql db delete -h

Screen Shot 2013-11-26 at 9.58.05 AM

The azure sql db delete command is the command to use to delete a specific SQL database. At the time of this writing there is an error in the Usage portion of the documentation. The administratorLogin parameter is missing. The documentation should actually read:

Usage: sql db delete [options] <serverName> <databaseName> <administratorLogin> <administratorPassword>

There are several parameters you need to provide in order to delete a SQL database:

  • serverName – the name of the SQL server that contains the database to be deleted
  • databaseName – the name of the SQL database to be deleted
  • administratorLogin – the administrator login for the SQL server
  • administratorPassword – the administrator password for the SQL server

Additionally, you can specify the -q, —quiet to suppress the confirmation prompt.

To delete a SQL database, enter the following int your CLI, substituting where appropriate:

azure sql db delete -q ‘[YOUR SQL SERVER NAME]‘ ‘[YOUR SQL DATABASE NAME]‘ ‘[YOUR ADMINISTRATOR LOGIN]‘ ‘[YOUR ADMINISTRATOR PASSWORD]‘

I used the following:

azure sql db delete -q ‘woa74eflzv’ ‘my_second_db’ ‘adam’ ‘[MY ADMINISTRATOR PASSWORD]‘

Screen Shot 2013-11-26 at 10.16.37 AM

Once the command completes you can use the azure sql db list command (http://thinkfirstcodelater.com/blog/?p=3553) to verify the database has been deleted.

Screen Shot 2013-11-26 at 10.18.36 AM

That’s it for now. In my next post I’ll show you how to use the Windows Azure cross platform command line tools to delete a SQL server.

Did you know you can try Windows Azure for free for 30 days? Just go to http://aka.ms/thecloud and sign up.

Read the original blog entry...

More Stories By Adam Grocholski

Hey there! My name is Adam Grocholski, and I'm a Technical Evangelist at Microsoft where I spend time focusing on Windows, Windows Phone, and Windows Azure. I live in the frozen tundra of Minnesota and run thinkfirstcodelater.com. You can also follow me on twitter at @codel8r.