You can connect to Microsoft SQL Server from ArcGIS clients. To do so, install the Microsoft SQL Server Native client or Microsoft ODBC driver 11 for SQL Server on the ArcGIS client machine and connect to the database from the ArcGIS client.
Once the client is configured, create a connection file. To use the data stored in SQL Server in services published to ArcGIS Server, register the database or geodatabase with the GIS server.
Connect from ArcMap
To connect to a database or geodatabase in SQL Server from ArcMap, install the SQL Server native client or Microsoft ODBC driver 11 for SQL Server on the ArcMap computer and create a connection file in the Catalog tree. 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 SQL Server client
If you connect to SQL Server 2012, use the SQL Server Native client. If you connect to SQL Server 2014 or Microsoft Azure SQL Database, use the Microsoft ODBC driver 11 for SQL Server. You can obtain and install these from the Microsoft Download Center or from My Esri. Install the client on all computers where ArcMap is installed.
If you are installing the client on a 64-bit operating system, run the 64-bit executable; it installs both 32- and 64-bit files. If you run the 32-bit SQL Server Native client on a 64-bit operating system, it will fail.
Connect to the database
You can connect to a database or geodatabase in SQL Server by adding a database connection under the Database Connections node in the Catalog tree in ArcMap or ArcCatalog.
- Expand Database Connections in the Catalog tree in ArcMap or ArcCatalog and double-click Add Database Connection.
- Choose SQL Server from the Database Platform drop-down list.
- Type the SQL Server instance name in the Instance 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 Instance 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 Instance 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 Instance text box.
If your SQL Database instance name is cloudy4u.database.windows.net, type cloudy4u.database.windows.net in the Instance text box. If you are using a SQL Server instance named terra\gis, type terra\gis in the Instance text box.
- 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.
- 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.
In the following example, a connection is made to the database, spatialdata, on the SQL Server instance server1\ss08r2 using database authentication.
- Click OK to connect.
A file is created in \\<computer_name>\Users\<user_name>\AppData\Roaming\ESRI\Desktop<release#>\ArcCatalog. If you encounter any problems with the connection, check the sdedc_SQL_Server.log file in the %TEMP% directory for extended error messages.
You can move the connection to another location; just be sure users and applications that need to make a connection have read access to the directory where you place the connection file.
If you use the data from this connection as the source for a service, such as a geoprocessing or geocoding service, you may need to place the connection file in a shared location on your network. See Preparing resources for publishing as services for more information about sharing a connection file.
Connect to a specific geodatabase version
When you initially connect to a geodatabase, you connect to the Default version using the Database Connection dialog box. If you use geodatabase versioning and want to connect to a different transactional or historical version, change versions using the Geodatabase Connection Properties dialog box. For more information, see Connect to a specific geodatabase version.
Connect from ArcGIS for Server
If SQL Server and ArcGIS for Server are running on separate servers, install the SQL Server Native client on the ArcGIS for Server computer. First, though, be sure your SQL Server instance is configured to accept remote connections.
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 SQL Server client
If ArcGIS for Server and SQL Server are installed on different computers, you must install a 64-bit SQL Server client on the ArcGIS for Server computer.
If you connect to SQL Server 2012, use the SQL Server Native client. If you connect to SQL Server 2014 or Microsoft Azure SQL Database, use the Microsoft ODBC driver 11 for SQL Server. You can obtain and install these from the Microsoft Download Center or from My Esri.
Register the database
If you want your web services to use the data in your SQL Server database or a geodatabase in SQL Server, register it with ArcGIS Server. For geodatabases in SQL Server, you have two registration options. See About registering your data with the server for information on registration options and links to topics with instructions for registering your database.