How to change field order in geodatabase - one solution

4290
4
05-13-2016 11:54 AM
Labels (1)
TimMinter
Occasional Contributor III
1 4 4,290


Changing the order of fields in an existing geodatabase feature class or table has been challenging since the early days of ArcGIS - ArcMap and ArcCatalog.  Without bothering to dig up all of the historical references, blog posts, issue reports, bug reports, great idea postings, workarounds, previous methods and tools, etc, I point at one simple solution to this 16 year old problem (it's old enough to drive in most US states).

  1. Purchase and install Sparx Enterprise Architect (EA) version 12.x or higher, Professional edition or higher, floating or single use license.
  2. ArcMap:  export your disorderly geodatabase as a Workspace XML
  3. EA:
    • Tools > Options > Objects > uncheck "Sort Features Alphabetically" > Close
    • File > New Project > name it > Model Wizard > click "Geospatial" > check the "ArcGIS Workspace" box > OK
    • Extensions > ArcGIS > Import ArcGIS Workspace XML
    • double-click the "Workspace" object in the project browser to open a graphic view of your geodatabase schema
    • find the disorderly table or feature class graphic
    • left-click any of the fields in the table or feature class graphic to select it
    • right-click the selected field > View Properties...
    • right-click the field that you want to be in a different order and choose "Move up" or "Move down" as pleases you
    • Close the field properties viewer
    • Extensions > ArcGIS > Export ArcGIS Workspace XML
  4. ArcMap:
    • import your orderly schema from your Workspace XML into your geodatabase
    • load your data into your new schema
    • breathe, sigh, rejoice...  move along

That's it.  That's all I got.

Happy Friday,

tim

4 Comments
JoshuaBixby
MVP Esteemed Contributor

Exporting a geodatabase to an XML workspace is a time consuming process, and generates huge files.  Also, Esri's documentation on Copying a geodatabase using geodatabase XML workspaces even recommends against it:

The resulting geodatabase XML document can be huge when you copy both the data as well as the schema. Generally, this alternative is not recommended for copying geodatabase data. Alternatives for making a geodatabase copy include the use of the Copy tool and the Extract Data Wizard in ArcMap to copy subsets of the information.

Beyond the practical issues, one can argue philosophically against putting any importance behind column/field order in databases.  Relational databases, which enterprise geodatabases are implemented on top of, are based on the Relational Model, which is based on set theory and predicate logic.  Putting importance or dependencies on column/field order goes against the very foundation of relational databases.  Sure, there are some specific situations where having a certain column in a certain order/place is important, but those are implementation issues tied to specific systems.  Unless the design of the system was very flawed from the beginning, I struggle to see what value can come from wholesale rearranging columns within databases, especially large ones that are already being used in production.

TimMinter
Occasional Contributor III

I acknowledge and agree with your opinions, experience, and references.  I had a need.  That's how I met it.  It might prove useful to others.

JoshuaBixby
MVP Esteemed Contributor

If only reality wasn't so messy, we wouldn't need tools to help restructure entire schemas and data, but it is good to have them when we need them.

TimMinter
Occasional Contributor III

Well, not finding an edit button for that post.  2021 has arrived, Sparx EA 15.1 is installed and not up-to-date, and of course stuff has moved around.  Revised instructions:

Sparx EA:

  • Start > Preferences > Preferences > Objects > uncheck "Sort Features Alphabetically"
  • Publish > Import > ArcGIS (add the workspace XML, schema only)
  • double-click the "Workspace" object in the project browser to open a graphic view of your geodatabase schema
  • find the disorderly table or feature class graphic
  • right-click within the frame > Features > Attributes
  • right-click the field that you want to be in a different order and choose "Move up" or "Move down" as pleases you
  • Close the Features properties viewer
  • Extensions > ArcGIS > Export ArcGIS Workspace XML
  • Publish > Publish > ArcGIS > specify output XML filename and location > Export
About the Author
GeoJobs: Washington State Department of Social & Health Services; South Florida Water Management District; City of Asheville, North Carolina; St. Johns River Water Management District
Labels