AnsweredAssumed Answered

Database connections in arcgispro-py3

Question asked by John.Broecher on Mar 13, 2018
Latest reply on Mar 13, 2018 by bixb0012

Since Pro stores database connections in a project, how do we connect to a database from within a standalone python script? 

For example below is how I would have previously connected in ArcGIS 10.5

import arcpy

GDB_directory = r"C:\Python Testing"

targetEntGDB = r"Database Connections/espr1sql14.sde/"

extractedGDB ="600150be54a84779a461d4fc37247f91.gdb"

extractedGDB = GDB_directory + "\" +extractedGDB

arcpy.Copy_management(extractedGDB, targetEntGDB)

Outcomes