Skip to content

Connect to SQL Azure

A few weeks back Microsoft announced the first CTP of SQL Azure, its new cloud relational persistence offering. In this post I will show you how you can connect and query your SQL Azure DBs from your PC. There are two ways you can interact with SQL Azure, one is through the SQLCMD command line program and the other is through SQL Server Management studio. To connect to SQL Azure using the later, you need to follow these simple steps:

  1. Procure an activation code for SQL Azure (Since it is in CTP now). http://connect.microsoft.com
  2. Go to http://lx.azure.microsoft.com/ and activate you key. Then you can access SQL Azure from the portal (https://sql.azure.com) and create or drop databases, find out the connection strings and so on.
  3. To access the SQL Azure from SQL management studio, open the SQL Management studio 2008
  4. Cancel the login dialog box that will pop up
    Capture1
  5. Click on ‘New Query’
    Capture2
  6. Choose Database engine as the server type
  7. Enter the server name of the SQL Azure server. This information can be obtained from the SQL Azure portal. (no prefix, no suffix, no protocol should be appended).
  8. Enter the login name (<login_name>@servername)
  9. Enter password
  10. Click on Options
    Capture3
  11. Enter the database name (master or another other database if you have created one). If you don’t you won’t be able to switch later (“USE” statement is not supported).
  12. Specify the TCP protocol
  13. Click on connect to connect
    Capture4

 

 

 

 

After that you’ll be able to run your SQL commands against you cloud SQL server.

Published inMicrosoft Azure

2 Comments

  1. Thanks for such a beautifully composed, informative article.I think your designing work to this is really great .I really appreciate your work to this site.So thanks for it.I hope you can continue this type of hard work to this site in future also..Because this blog is really very informative and it helps me lot.

  2. I was curious if you ever considered changing the page layout of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better.

Leave a Reply

Your email address will not be published.