Field length not allowed to be changed for feature class in arccatolog

16173
6
Jump to solution
04-15-2015 05:37 AM
NaimeCelik
Regular Contributor

I have a feature class that I want to change field length. However it does not let me modify the value. I copied that feature class, still not changeable. When I create a new feature class in same file geodatabase , I can change field length but not for that specific data. How can I make data to permit field length change?

1 Solution

Accepted Solutions
GabrielUpchurch1
Deactivated User

Hi Naime,

Length is one of the properties of a field that cannot be changed for a feature class that already contains data.  From Help:  "Some field properties are defined when the table or feature class is created and cannot be changed, including field type, length, precision, and scale."  You can find the document here:  Understanding field properties, aliases, and table display options—Help | ArcGIS for Desktop .

It does appear that if the feature class is empty, you are able to change field length.  From Help:  "For empty geodatabase tables or feature classes, you can change field properties such as the field type, length, or nullability."  You can find the document here:  Alter Field—Help | ArcGIS for Desktop .

To change the field length of a field in a feature class that already contains data, creating a copy with the Feature Class to Feature Class tool should allow you to do this (ArcToolbox > Conversion Tools > To Geodatabase).  After specifying the input feature class in the tool, right click on the relevant field name in the "Field Map" section and select "Properties."  You can access and change the length property in the Output Field Properties dialog that opens.  Help document:  Feature Class To Feature Class—Help | ArcGIS for Desktop.

Hope this helps!

View solution in original post

6 Replies
GabrielUpchurch1
Deactivated User

Hi Naime,

Length is one of the properties of a field that cannot be changed for a feature class that already contains data.  From Help:  "Some field properties are defined when the table or feature class is created and cannot be changed, including field type, length, precision, and scale."  You can find the document here:  Understanding field properties, aliases, and table display options—Help | ArcGIS for Desktop .

It does appear that if the feature class is empty, you are able to change field length.  From Help:  "For empty geodatabase tables or feature classes, you can change field properties such as the field type, length, or nullability."  You can find the document here:  Alter Field—Help | ArcGIS for Desktop .

To change the field length of a field in a feature class that already contains data, creating a copy with the Feature Class to Feature Class tool should allow you to do this (ArcToolbox > Conversion Tools > To Geodatabase).  After specifying the input feature class in the tool, right click on the relevant field name in the "Field Map" section and select "Properties."  You can access and change the length property in the Output Field Properties dialog that opens.  Help document:  Feature Class To Feature Class—Help | ArcGIS for Desktop.

Hope this helps!

NaimeCelik
Regular Contributor

Thank you for your respond, I try to run the tool and changed it as your instructed. It was a great help.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

I've run into this issue a lot myself.  I started to develop a tool that can alter a field's type or length.  I haven't tested it much, but seems to be working for the most part.  You can download the tool from the below link if you want to give it a shot:

http://epro.maps.arcgis.com/home/item.html?id=646e18e739324964b5f4e5f4bb04735e

RichardFairhurst
MVP Honored Contributor

Jake:

I see that your tool is trying to automate the Add Field, Calculate Field, Delete Field, Alter Field (to rename it) workaround steps that normally have been done when the original feature class/table is changed rather than creating a new fc/table.  The Alter Field step of the tool will only work if the input is within a geodatabase.  For shapefiles you have to do a second Add Field, Calculate Field, Delete Field to get the original field name back.  Your tool should test the input to determine if the Alter Field step can be done and otherwise do the 3 alternative steps.  Of course, this workaround technically is not altering the original field, just the original fc/table.

The unfortunate consequence of this workaround is that the fields are reordered, with the new version of the field being added to the end of the fc/table's field set rather than remaining in its original position, but if retaining the ObjectIDs of the original features/rows is important, your approach would be necessary.  The only way to keep the field order is to create a new fc using a tool like the Feature Class to Feature Class tool as Gabriel suggested, but then all ObjectIDs will be renumbered (and I think that GlobalIDs also regenerate or cease to function).

AbhinavReddy1
Occasional Contributor

Hi Jake,

I ran into the same issue and I wanted to check your tool. But it say's "permission denied" - when trying to download. Can you help me with that?

0 Kudos
Asrujit_SenGupta
MVP Regular Contributor

What are you trying to do with the Field's length? Increase or decrease? This is an old post and things have changed since...

Modifying field properties—ArcGIS Help | ArcGIS Desktop 

Length

If your table or feature class does not contain data, you can increase or decrease this value. If your table or feature class contains data, you can only increase the field length.

0 Kudos