HOW TO
By default, when creating a SQL Server database connection using the Create Database Connection geoprocessing tool in ArcGIS Pro, the Additional Properties section is not available to specify parameters such as ApplicationIntent, Encrypt, and TrustServerCertificate. This article describes the workflow to append these parameters using ArcPy and create a connection file with the required properties.
Prerequisites to ensure SQL Server database connection properties are appended successfully: • Create a SQL Server database in SQL Server Management Studio. Refer to Microsoft Learn: Create a database for more information. • Install the Microsoft ODBC driver for the SQL Server as an SQL client that runs on the ArcGIS Pro machine. Refer to ArcGIS Pro: Install the ODBC driver for SQL Server for more information.
import arcpy, os # Additional parameters appended to the instance string additionalparams = ";Encrypt=no;TrustServerCertificate=yes;ApplicationIntent=READWRITE"
# Use ArcPy to append the SQL Server database additional parameters arcpy.management.CreateDatabaseConnection( out_folder_path=r"C:\FOLDER NAME", # input your folder path to store the .sde file out_name="testextraparamas_frompythonwithapplicationint1", # rename the folder if needed database_platform="SQL_SERVER", # This is based on the database type used instance="YOUR SQL SERVER INSTANCE" + additionalparams, account_authentication="DATABASE_AUTH", username="YOUR SQL SERVER DATABASE USERNAME", password="YOUR SQL SERVER DATABASE PASSWORDS", save_user_pass="SAVE_USERNAME", # rename if needed database="YOUR DATABASE NAME", # input your SQL Server database name schema="", version_type="TRANSACTIONAL", version="sde.DEFAULT", ) # Display a message if additional parameters are appended successfully sde_path = os.path.join(r"C:\FOLDER NAME", "testextraparamas_frompythonwithapplicationint1.sde") print(f"Created: {os.path.exists(sde_path)} | Path: {sde_path}") print("Appended params:", additionalparams.strip(";"))
The Python window below shows the example of a message displayed if the connection properties are appended successfully.


Article ID: 000039977
Get help from ArcGIS experts
Start chatting now