Saturday, February 2, 2013

Connecting SSMS to SQL Azure

When using SSMS to connect to a SQL Azure DB, some typical ways of connecting simply don't work.

Note: I believe I had this issue because I wasn't using SQL Server 2008 R2. That appears to be necessary for the normal login dialogs, and object explorer, to work.

The first issue is the connection dialog box. When you enter your information and hit connect:


You get this:


The way around this is to cancel the connection dialog and click the New Query button, in SSMS, even though you're not yet connected:


The same dialog box will come up, but this time you'll be able to connect. HOWEVER, when you try to select your DB:


You'll get this error:


Note: The USE statement won't work either.

To change the DB, do this:


You'll be presented with the same connect dialog as earlier. This time, click Options:


Select your DB here:


Now you're connected!

Note: You can select the DB, within options, when you first connected, after clicking New Query.