Getting Started with the SQL Azure Database Manager
By: Arshad Ali | Comments | Related: > Azure
With SQL Azure, your server and databases are hosted in the cloud and you use SQL Server Management Studio (SSMS) to connect to your SQL Azure database. Do you really need to install the SQL Server client tools to be able to connect to SQL Azure database or is there any other way to connect from any machine without installing the SQL Server client tools (SQL Server Management Studio)?
The Database Manager for SQL Azure is a lightweight, easy to use, thin web-based database management tool for connecting to a SQL Azure database and managing different database management tasks like; creating and editing tables, views and stored procedures, editing table data, writing and executing T-SQL queries, etc...
The database manager is not a replacement of SQL Server Management Studio (SSMS) as it only supports basic database management tasks though it does not require the user to install SQL Server client tools on their machine to be able to connect and work on SQL Azure. This has been designed specifically for web developers/technology professionals who want a simple and straightforward way to connect to a SQL Azure database, develop, deploy and manage their data. All they need is a web browser with Silverlight and an internet connection.
Launching Database Manager
Although you can directly use the URL (https://manage-sgp.cloudapp.net/) to launch the Database Manager, the best practice is to launch database manager directly from the SQL Azure portal, instead of directly using the URL. This ensures that you are running on an instance of database manager that is closest to your SQL Azure datacenter (there are multiple instances of database manager co-located side by side with each SQL Azure datacenter). To launch it from the portal, connect to the SQL Azure portal, select the database on which you want to get connected and click on the Manage menu as shown below.
The first screen of the Database Manager is a place where you specify the SQL Azure server name, database name, login name and password. Please note if you are coming from the SQL Azure portal, the SQL Azure server name, database name and login name will automatically populated in the login screen and you simply need to enter the password and click on the Connect button.
The moment you specify all the required information and click on the Connect button, the Database Manager will try to connect to the specified server and database. In case of any error, an error hyperlink appears on bottom left, to see the error click on the link (as shown in the next image). Click on the Back button to return to "Log on" screen, specify the correct information or resolve the issue and try again.
Once connected, on left side you will notice a tree view controller which has Tables, Views and Stored Procedures nodes. You can expand these nodes to see the respective objects under each node. On top you can see a contextual ribbon containing the menu for basic database management tasks. In the detail pane, you can browse different information about the database.
Working with Database Manager
Once connected you will see the contextual ribbon on the top of the screen. For example as you can see two tabs below, the first (Database) tab has commands for general database work where the second (Query) tab has commands for general query related tasks. You can click on the New Query command which will open the query window in the detail pane, write your query and click on the Execute command to execute it. You can also click on the Save command to save your query to your local machine. Likewise if you have query file, you can open it by clicking on the Open Query command.
In SSMS we have Results and Message tabs when a query gets executed, here we also find the same tabs when you execute the query by clicking on the Execute command in the Query ribbon.
The Database Manager allows you to create and edit stored procedures and while doing this related commands appear in the Stored Procedure ribbon on the top. You can modify the parameter list, modify the body of the procedure and once you are done you can execute your procedure from here as well.
The Database Manager also allows you to create and modify tables and views. For example, as you can see below, I am modifying the Contact table and its related commands appear in the Table ribbon on the top. You can modify the columns, their data types, default values, define an identity, etc...
- The Database Manager is not intended for creating new databases it is used to manage existing SQL Azure databases.
- The best practice is to launch Database Manager directly from the SQL Azure portal, instead of directly using the URL. This ensures that you are running an instance of Database Manager that is closest to your SQL Azure datacenter (there are multiple instances of Database Manager co-located side by side with each SQL Azure datacenter).
- Review The Database Manager for SQL Azure article on msdn
- Review Known Issues in The Database Manager for SQL Azure article on msdn
- Review other SQL Azure related tips
About the author
View all my tips