About updating data using SQL
After loading a large amount of data into your geodatabase, you might want to update many attribute values at once. In the case of an ArcSDE geodatabase, you can do this by versioning the data, then editing in ArcMap to perform the update. The problem with this approach is that all the updated features will be in the delta tables; you should compress your database to move the updated features into the base tables.
Another approach is to perform bulk attribute updates, which can be done using SQL before the data is versioned. Using this approach means that these bulk updates are done before the database is versioned, and all the features remain in the base tables.
There are some rules that apply to performing updates with SQL. It is important to understand your data models so the attributes you update don't affect other objects in the database through relationships or other behavior. Using SQL for this operation without a thorough understanding of your data model may result in data corruption. For example, if you use SQL to modify the attributes of a feature from which text is derived for feature-linked annotation, the annotation features will not be messaged to update themselves, so the annotation and feature will be out of sync. When these attributes are updated in ArcGIS, all necessary behavior is executed.
The following is a list of some important guidelines when performing updates with SQL outside the context of ArcGIS:
- Never update records in SQL after your data has been versioned.
- When updating data using SQL, do not modify attributes that, through geodatabase behavior, affect other objects in the database.
- Never update the ObjectID field with SQL.
- Never update the Enabled or AncillaryRole field or a weight field for a geometric network feature class using SQL. When these fields are updated through ArcGIS, it results in changes to the geometric network topology tables that SQL does not trigger.
- Never update the Element, SymbolID, TextString, FontName, FontSize, Bold, Italic, Underline, VerticalAlignment, HorizontalAlignment, XOffset, YOffset, Angle, FontLeading, WordSpacing, CharacterWidth, CharacterSpacing, FlipAngle, or Override fields of an annotation feature class. When these fields are updated through ArcGIS, it results in changes to the feature's BLOB element that SQL will not trigger. When you update these fields using SQL outside ArcGIS, the text symbol fields associated with each annotation feature for all of the updated rows won't update.