Limit on adding fields to an attribute table of a shapefile?

318
2
07-09-2020 08:57 AM
RobertRies
New Contributor

I am new to this forum and have a question about creating and populating fields in attribute table of a shapefile. We are working at the parcel level and have a python script that calculates 12 metrics for each parcel each day for a year. Parcel characteristics, weather and utility data are used in the iterative daily calculations. The start and end dates are specified, twelve new fields are created each day, and the metrics are calculated for each parcel.

The issue is: When writing to the attribute table of the shapefile, it fails after about 3 months with a cannot create field error. The error occurs after the same number of days regardless of the start and end dates. When writing to a standalone table, however, it completes for a year without an issue.

Question: Is there a limit on the number of fields in the attribute table of a shapefile and does not apply to a standalone table?

Thanks in advance, Robert

0 Kudos
2 Replies
JoshuaBixby
MVP Esteemed Contributor

See:  Geoprocessing considerations for shapefile output—Help | Documentation 

Attribute limitations

  • The maximum record length for an attribute is 4,000 bytes. The record length is the number of bytes used to define all the fields, not the number of bytes used to store the actual values.
  • The maximum number of fields is 255. A conversion to shapefile will convert the first 255 fields if this limit is exceeded.

LanceKirby2
Occasional Contributor II

Using a feature class within a geodatabase would be better suited for this task. See FAQ: Is there a limit to the number of fields that can be added to a table or feature class in a geo...