I have a feature class with a string field that I want to update the length from 10 to 25.
Is there a way or a tool to update this property without having to create a new field and using field calculator to move over the records from old to new field?
This script below does what I want, the only thing is it pushes the updated field to the end of the table (not keeping the original field order).
http://arcscripts.esri.com/details.asp?dbid=16503
Another option that seemed promissing is to use the Feature Class to Feature Class tool (access this tool by right clicking a layer in ArcCatolog and selecting Export>to Geodatabase single option) . It does create a new layer, however you can update field names and property information. It also appears that you can change the field order using the "Move Input Field Up/Down" arrows, but they seem to not work.
There has to be a solution to just edit field properties without having to create a new field.
Answer
As far as I am aware there is currently no way to make schema edits in a geodatabase without either dropping and adding fields, or deleting and reloading feature classes/tables. The latter is what I recommend in order to maintain field order.
What I normally do is:
- Make a backup of the original feature class
- Export the original feature class's schema to an XML file
- Modify the schema in a text editor or ArcGIS Diagrammer 10.0, 10.1 or 10.2.
- Delete the original feature class
- Import the schema back into the geodatabase
- Use the Append tool, Simple Data Loader or Object Loader to load the contents of the backup feature class into the newly imported feature class. See the "About loading data into existing feature classes and tables" help topic for more information.
At ArcGIS 10.1 and up there are geoprocessing tools to handle the XML import/export but at 10.0 and earlier you either have to use ArcObjects or do it manually. For an ArcObjects example see: Export XML Workspace Document
No comments:
Post a Comment