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?

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jan 23, 2017 at 21:18
2
  • Cross-posted as stackoverflow.com/q/41817107/820534 Commented 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. Commented 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.

answered Jan 25, 2017 at 19:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.