Welcome!

Open Source Authors: David Tishgart, Ali Hussain, Liz McMillan, Kevin Benedict, David Smith

Blog Feed Post

Azure CLI Day 53 – sql db list

bash-azure

In my previous post (http://thinkfirstcodelater.com/blog/?p=3540) I showed you how to create a SQL database using the Windows Azure cross platform command line tools. In this post I’ll show you how to use these tools to list your 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 list -h

Screen Shot 2013-11-26 at 8.21.41 AM

The azure sql db list commands lists SQL databases on a specific SQL server. In order to use the command you must provide the following parameters:

  • serverName – the name of the SQL server you want to list databases for
  • administratorLogin – the administrator login of the SQL server
  • administratorPassword – the administrator password of the SQL server

To list databases on a particular server, enter the following into your CLI, substituting where appropriate:

azure sql db list ‘[YOUR SQL SERVER NAME]‘ ‘[YOUR ADMINISTRATOR LOGIN]‘ ‘[YOUR ADMINISTRATOR PASSWORD]‘

I used the following:

azure sql db list ‘woa74eflzv’ ‘adam’ ‘[MY ADMINISTRATOR PASSWORD]‘

Screen Shot 2013-11-26 at 8.28.44 AM

This will give you a basic list of the databases associated with a specific SQL server. If you would like to see detailed information about each database use the —json option by entering the following into your CLI:

azure sql db list —json ‘[YOUR SQL SERVER NAME]‘ ‘[YOUR ADMINISTRATOR LOGIN]‘ ‘[YOUR ADMINISTRATOR PASSWORD]‘

I used the following:

azure sql db list —json ‘woa74eflzv’ ‘adam’ ‘[MY ADMINISTRATOR PASSWORD]‘

Screen Shot 2013-11-26 at 8.32.55 AM

That’s it for now. In my next post I’ll show you how to view the details of a specific SQL database using the Windows Azure cross platform command line tools.

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.