ArcGIS – How to Use SQL to Update Feature Class Attributes in Versioned Geodatabase

arcgis-9.3sql serverversioning

ArcGIS Workgroup Edition 9.3.1, MS SQL 2005 Express

I have some attribute data that I want to periodically update with information from another RDBMS using SQL UPDATE commands. The data is versioned and we were planning on creating a "sql-updates" version just for this purpose, since others have said that doing this in the default version is not a good practice. Is this possible and what would be the general or best method of doing it?

One possibility would be using these stored procedures: set_current_version, edit_version (1 – start session), run my updates, and edit_version (2 – close session). I don't know if this is the correct way, and if delta tables get entries used for reconcilliation with the other versions. Note that "sdetable" is not available with Workgroup edition.

Another possibliity would be creating a separate table for this data, then joining the data with the feature class data, which would allow direct SQL updates to the separate table.

Best Answer

The *set_current_version/edit_version* that you describe above is the right way to do it. The delta tables will get modified accordingly. Afterwards, you will need to reconcile (pushes changes and figures out if there are any conflicts)and post (you can think of it as a commit) with the parent version.

The only caveat is that if you have GeoDatabase-level customizations (e.g. some custom ArcMap extension that runs during your edit sessions) it will not fire since you are doing edits at one level of abstraction below the GeoDatabase.

Related Question