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

7979
6
Jump to solution
04-15-2015 05:37 AM
Highlighted
Occasional 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
Highlighted
Occasional Contributor III

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
Highlighted
Occasional Contributor III

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

Highlighted
Occasional Contributor

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

Reply
0 Kudos
Highlighted
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

Highlighted
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).

Highlighted
New Contributor II

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?

Reply
0 Kudos
Highlighted
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.

Reply
0 Kudos