2

I have a set of file geodatabases with the same schema as my SQL Server Express geodatabase. Using this script, I am trying to append the feature classes of each FGDB into the corresponding feature class in the SQL Server Express GDB.

import arcpy, os

inputGDB = arcpy.GetParameterAsText(0)
sqlDB = arcpy.GetParameterAsText(1)
arcpy.env.workspace = sqlDB

sqlFCs = arcpy.ListFeatureClasses()
for fc in sqlFCs:
    sourceFC = str(fc)[14:]
    if arcpy.Exists(os.path.join(inputGDB, sourceFC)):
        arcpy.AddMessage("Appending " + sourceFC + " to " + fc)
        fcPath = sqlDB + "\\" + fc
        arcpy.Append_management(os.path.join(inputGDB,sourceFC), fcPath)

When I attempt this with my python script, I get the following error:

ERROR 000732
Target Dataset: Dataset Database Servers\WOS2UA52417ZT_SQLEXPRESS.gds\SCAT_Data (VERSION:dbo.DEFAULT)\SCAT_Data.DBO.trackjsonpnts does not exist or is not supported

It is the same if I try to simply use the Append tool from ArcToolbox. Is there a way to append feature classes in an SQL database?

2
  • Cross-posted as stackoverflow.com/q/41817107/820534
    – PolyGeo
    Jan 24, 2017 at 3:48
  • I have gotten this exact script to work if I reference the SQL geodatabase via Database Connections. However, I am unable to reference the same SQL geodatabase via Database Servers, even though the data is visible in ArcCatalog.
    – spaine
    Jan 24, 2017 at 18:09

1 Answer 1

2

The answer is that the Database Server connection to a SDE database using SQLexpress is not appropriate for editing data, only for administering it (i.e. permissions, etc.) You must connect to the same database using the Database Connections node in ArcGIS, and use that connection for editing purposes. This tool does work as it should when using the appropriate Database Connection as the output workspace.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.