Select to view content in your preferred language

Change Name of Global ID field?

3418
1
12-12-2011 10:26 AM
DerrickFrese
Emerging Contributor
I have a File Geodatabase Feature Class with a Global ID field.

Anybody know if you can change the name of the Global ID field while retaining the field's properties?  I would like the field to be called "Segment_ID", but to act as the Global ID field normally does.

Thanks.
0 Kudos
1 Reply
HeatherMcCracken
Esri Contributor
You cannot change the name of the existing GlobalID field.

However, to get the result you want, there are 2 sets of steps you can follow depending if you need/want to preserve the existing GlobalID values in your data, or if its ok to assign new GlobaID values to your rows.


PRESERVING GLOBALID values:
1) Create a new GUID field called "Segment_ID"
2) Calc the values from your GLOBAL_ID field into the Segment_ID field -
3) Delete the GlobalID field using the code in the help doc below (IClassSchemaEdit3::DeleteGlobalID)
4) Register the Segment_ID field as a GlobalID field (IClassSchemaEditEx::RegisterGlobalIDColumn)

If you DON't need to PRESERVE current GlobalID values
1) Delete the GlobalID field using the code in the sample below
2) Add a GlobalID field using the code, passing the desired name for the field as an argument. ( (IClassSchemaEdit3::AddGlobalID)


Help Docs with sample Code:
Adding and deleting GlobalIDs:  http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/000100000068000000.ht...

Copying or loading data while preserving GlobalID values:  http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/00010000019v000000.ht...
0 Kudos