Add Incrementing ID Field (Data Management)

License Level:BasicStandardAdvanced

Summary

The Add Incrementing ID Field tool adds a database-maintained ID field to an existing table or feature class in an IBM DB2, Microsoft SQL Server, Oracle, or PostgreSQL database. This type of field is required on all feature classes or tables you plan to edit through a feature service.

Usage

Syntax

AddIncrementingIDField_management (in_table, {field_name})
ParameterExplanationData Type
in_table

The location and name of the table to which you want to add an ID field.

Table View
field_name
(Optional)

The name to be used for the ID field. If no input is provided, the name defaults to objectid.

String

Code Sample

Add Incrementing ID Field with Existing Connection File

Adds an ID field—FSID—to a table named violations owned by user insp when run from an ArcGIS for Desktop client computer on which a pre-created database connection file (.sde) is stored in the default connection file location.

AddIncrementField_management("Database Connections//insp.violations", "FSID")

Environments

This tool does not use any geoprocessing environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013