Is there a good way to update an SDE with FGDB data?

3124
8
10-07-2015 11:41 AM
PayneRingling
New Contributor III

I have tried making an XML and using that as the upload but it just wants to give me additional copies of the same data. I have heard that I can do a truncate and append but is that only for table? Is it available for use on multiple feature classes?

I used to have a nice SDE connection to the County where it was easy to move the data over from their SQL to our but the connection was dropped a couple weeks ago and now I only have an FTP with a FGDB containing the majority of their data that I need to clip out for our City's needs.

Does anyone have any ideas?

Thanks-

Diane

City of Sarasota

8 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Diane,

Truncate/Append will work on feature classes.  This method will work.  One thing to note, if the feature class is registered as versioned and the truncate/append is performed often, be sure you are compressing your database on regular basis.

0 Kudos
PayneRingling
New Contributor III

Jake- There are a slew of feature classes though will I need to add them all one at a time?

0 Kudos
JakeSkinner
Esri Esteemed Contributor

You can run the truncate/append tool in batch mode by right-click on the tool in the Catalog/Toolbox window > Batch.  Though, it will most likely be more beneficial to create a script/model to automate this process if the same feature classes are always updated. 

0 Kudos
JoeBorgione
MVP Emeritus

I'm a huge fan of the simple data loader. 

That should just about do it....
0 Kudos
AsrujitSengupta
Regular Contributor III
  • How much data are you updating?
  • Is this a daily, weekly, monthly process?

The 'Truncate Table' tool will not work, if the Feature Class is Registered as Versioned. You will then have to use 'Delete Features' or 'Delete Rows' tool.

George_Thompson
Esri Frequent Contributor

Adding the Geodatabase​ group.

--- George T.
0 Kudos
RandyKreuziger
Occasional Contributor III

I'm assuming the only data coming from the county is data they manage in the first place so that your copies in SDE aren't versioned is that correct?

I've sent up 3 scheduled python jobs to handle cases like this.

Script 1 download and unzips the file geodatabase.

Script 2 copies up to a staging SDE database all the feature classes that need to be loaded.  You could do your clipping as part of this script.

Script 3 compares the schemas of the staged feature classes to the existing feature classes in our corporate SDE database.  If the schemas match I do the truncate append, if they don't match I send out an email alert and move on to the next feature class.

You could easily combine scripts 1 and 2 to keep things simple.

0 Kudos
PayneRingling
New Contributor III

Yes, you are correct the data is all Countywide and it is not version but rather a 'copy' of the SDE that has been packaged up and place in their FTP location as a zip.

Would it be possible to get a copy of your scripts. They sound like exactly what I would like to do but I am a newbie at scripting but could modify one.

0 Kudos