Skip To Content

Connect to Microsoft SQL Server from ArcGIS

You can connect to Microsoft SQL Server from ArcGIS clients. To do so, install a supported Microsoft SQL Server ODBC driver on the ArcGIS client machine and connect to the database from the ArcGIS client.

Next, create a connection from an ArcGIS Pro project. To use the data stored in SQL Server in layers published to your portal's federated servers, register the database or geodatabase with the federated ArcGIS Server sites.

Connect from ArcGIS Pro

To connect from an ArcGIS Pro project to SQL Server, install the Microsoft ODBC driver for SQL Server on the ArcGIS Pro machine and create a database connection. First, though, be sure your SQL Server instance can accept connections from remote computers.

Configure the instance to allow connections

By default, SQL Server instances are not configured to allow connections from other computers. If you have a new installation of SQL Server, be sure the SQL Server service is running and listening on the correct ports. See Microsoft SQL Server documentation for more information.

Install the ODBC driver for SQL Server

Obtain the Microsoft ODBC driver for SQL Server from the Microsoft Download Center or from My Esri. Be sure to get the Microsoft ODBC driver that is supported for the version of SQL Server to which you want to connect. Install the driver on all computers where ArcGIS Pro is installed.

Connect to the database

Add a database connection using the Database Connection dialog box or the Create Database Connection tool. The following steps describe using the Database Connection dialog box.

  1. Right-click Databases in the Catalog pane and click New Database Connection.
  2. Choose SQL Server from the Database Platform drop-down list.
  3. Type the SQL Server instance name in the Data source text box.

    For example, if you are using a default SQL Server instance, you can specify the instance name or the IP address of the server in the Data source text box. If specifying an IPV6 address, enclose the address in brackets. For example, if the IPV6 address of the server is 2000:ab1:0:2:f333:c432:55f6:d7ee, type [2000:ab1:0:2:f333:c432:55f6:d7ee] in the Data source text box.

    If your database is listening on a port other than the default (1433), include the port number in the instance. For example, if the SQL Server instance is basset\spatial and is listening on port 61000, type basset\spatial,61000 in the Data source text box.

    If your SQL Database instance name is cloudy4u.database.windows.net, type cloudy4u.database.windows.net in the Data source text box. If you are using a SQL Server instance named terra\gis, type terra\gis in the Instance text box.

  4. Choose the type of authentication to use when connecting to the database: Database authentication or Operating system authentication.
    • If you choose Operating system authentication, you do not need to type a user name and password—the connection is made using the login name and password used to log in to the operating system. If the login used for the operating system is not a valid database login, the connection fails.
    • If you choose Database authentication, you must provide a valid database user name and password in the User name and Password text boxes, respectively. User names can be a maximum of 30 characters.

      Uncheck Save user name and password if you prefer not to save your login information as part of the connection; doing this can help maintain the security of the database. However, if you do this, you will be prompted to provide a user name and password every time you connect. Also note that Save user name and password must be checked for connection files that provide ArcGIS services with access to the database or geodatabase or if you want to use the Catalog search to locate data accessed through this connection file.

    Note:

    Outside of ArcGIS, you can create user names in SQL Server that contain special characters. These user names must be delimited whenever they are used. ArcGIS will add the delimiter automatically when it is passed to SQL Server; you do not need to include delimiters with the user name. For example, if your user name is map.user, type map.user, not "map.user" in the User name text box. For more information on regular and delimited identifiers, see your SQL Server documentation.

  5. In the Database text box, type or choose the name of the specific database you want to connect to on the SQL Server or SQL Database instance. The database name is limited to 31 characters.
    Tip:

    The database name is optional when connecting to a SQL Server instance but only if you want to connect to the database that has been assigned as your default database in the SQL Server instance. The database name is required when connecting to SQL Database.

  6. Click OK to connect.

Connect from ArcGIS Server

If SQL Server and ArcGIS Server are running on separate servers, install the Microsoft ODBC driver for SQL Server on all machines in the ArcGIS Server site. First, though, be sure your SQL Server instance is configured to accept remote connections.

If SQL Server and your portal's federated ArcGIS Server sites are running on separate servers, install the Microsoft ODBC driver for SQL Server on all machines in each of the federated server sites.

Configure the instance to allow connections

By default, SQL Server instances are not configured to allow connections from other computers. If you have a new installation of SQL Server, be sure the SQL Server service is running and listening on the correct ports. See Microsoft SQL Server documentation for more information.

Install the ODBC driver for SQL Server

If ArcGIS Server and SQL Server are installed on different computers, you must install a 64-bit Microsoft ODBC driver for SQL Server on each machine in the ArcGIS Server site. You can obtain and install the driver from the Microsoft Download Center or from My Esri. Be sure to get the Microsoft ODBC driver that is supported for the version of SQL Server to which you want the ArcGIS Server site to connect.

Register the database

If you want the services you publish to your portal's federated servers to use the data in your database or geodatabase in SQL Server without copying data, you must register the database with the federated ArcGIS Server sites. For geodatabases in SQL Server, you have two registration options. See About registering your data with ArcGIS Server for information on registration options and links to topics with instructions for registering your database.