简体   繁体   中英

Connecting to SQL Azure via Management Studio

I have a SQL Azure database. I can successfully connect to the database via the Azure management portal. In addition, I can successfully connect to the database from my application using the Entity Framework. Unfortunately, I cannot connect to the database via SQL Server Management Studio.

My thought was that SQL Server Management Studio could not connect to the 'master' database. For that reason, it would fail. So, I tried adding the database name via the "Connect to Database" field on the "Connection Properties" tab. Yet, I get the same error. The error looks like the following:

TITLE: Connect to Server
------------------------------

Cannot connect to tcp:{serverName}.database.windows.net,1433.

------------------------------
ADDITIONAL INFORMATION:

Login failed for user '{username}'.
This session has been assigned a tracing ID of '{id}'.  Provide this tracing ID to customer support when you need assistance. (Microsoft SQL Server, Error: 18456)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476

What am I doing incorrectly here? This "server" has 2 SQL Azure databases on it that I'd like to access via management studio. How do I add users so that i can login an manage those two databases? Is there a way to even manage users on a SQL Azure database? I can't seem to figure it out.

Thank you for your help.

What version of SQL Enterprise Management Studio are you using? You need at least SQL Enterprise Management Studio 2008 R2 or later. (Might as well get the latest: http://www.microsoft.com/en-us/download/details.aspx?id=29062 )

Assuming you've got that, you'd enter it like so in the Connect to Server dialog:

Server type:  Database Engine
Server name:  tcp:servername.database.windows.net
Authentication:  SQL Server
Login: username@servername
Password: password

That should do it -- the other thing to check are the firewall restrictions. You'd be seeing a different error ("client IP address is not allowed access") but it's good to verify that, anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM