Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 3.91 KB

sql-database-sql-server-management-studio-connect-server-principal.md

File metadata and controls

36 lines (22 loc) · 3.91 KB

Connect to Azure SQL Database using SQL Server Authentication

The following steps show how to connect to an Azure SQL server and database with SSMS. If you don't have a server and database, see Create a SQL database in minutes to create one.

  1. Start SSMS by typing Microsoft SQL Server Management Studio in the Windows search box, and then click the desktop app.

  2. In the Connect to Server window, enter the following information (if SSMS is already running, click Connect > Database Engine to open the Connect to Server window):

  3. Click Connect.

  4. By default, new servers have no defined firewall rules so clients are initially blocked from connecting. If your server does not yet have a firewall rule that allows your specific IP address to connect, SSMS prompts to create a server-level firewall rule for you.

    Click Sign in and create a server-level firewall rule. You must be an Azure administrator to create a server-level firewall rule.

    ![SQL Server Management Studio: Connect to SQL Database server](./media/sql-database-sql-server-management-studio-connect-server-principal/newfirewallrule.png)
    
  5. After successfully connecting to your Azure SQL database, Object Explorer opens and you can now access your database to perform administrative tasks or query data.

    new server-level firewall

Troubleshoot connection failures

The most common reasons for connection failures are mistakes in the server name, and network connectivity issues. Remember, <servername> is the name of the server, not the database, and you need to provide the fully qualified server name: <servername>.database.windows.net

Also, verify the user name and password do not contain any typos or extra spaces (user names are not case-sensitive, but passwords are).

You can also explicitly set the protocol and port number with the server name like the following: tcp:servername.database.windows.net,1433

Network connectivity issues can also cause connection errors and timeouts. Simply retrying to connect (when you know that the server name, credentials, and firewall rules are correct) can lead to success.

For details and more about connectivity issues, see Troubleshoot, diagnose, and prevent SQL connection errors and transient errors for SQL Database.