How to connect to a SQL Server database

Before you can connect to a database, you must create a server connection.

To create a connection

1. On the Database menu, click New Connection. The Database Connection Properties dialog box opens.

2. On the Database Connection Properties > General tab, specify the connection details:

  • Server: Select the server from the drop-down list.
  • Authentication: Choose the authentication mode from the drop-down list.
    • Windows Authentication
    • SQL Server Authentication
    • Active Directory - Universal with MFA authentication
    • Azure Active Directory - Password
    • Azure Active Directory - Integrated

    For more information about how to connect to a database with the Azure Active Directory authentication, see How to connect with Azure Active Directory authentication.

    • Login and Password: Enter the user credential details respectively. By default, the password is saved automatically. If you don’t want to save the password, clear the Allow saving password check box.
  • Database: Enter the name of a SQL database you want to connect to or select the database from the drop-down list. By default, the Show all databases check box is selected. If you want to hide all available for the connection databases in Database Explorer, clear the check box.
  • (Optional) Connection Name: The connection name is generated automatically from the host name. If you want to create a distinctive name for the connection, type the new name.
  • (Optional) Environment Category: Select the document category (Development, Production, Sandbox, and Test) from the drop-down list.

Choose server properties in the Database Connection Properties dialog

3. (Optional) On the Advanced tab, configure additional connection properties:

  • Connection timeout: Set the amount of time (in seconds) during which the server should wait to establish a connection. The default value is 15 seconds.
  • Execute timeout: Set the amount of time (in seconds) during which the task should be completed. The default value is 0 seconds.
  • Encrypt connection: Select the check box if you want to use the encrypted connection.
  • Enter additional string connection parameters: Set additional connection properties to the connection string.

4. (Optional) To verify the connection, click Test Connection.

5. Click Connect to create the connection.