HOW TO

Select an existing field as the ObjectID field when adding a database table in ArcGIS Pro

Last Published: August 2, 2021

Summary

All layers in ArcGIS require a unique identifier. Since the value in the unique identifier field identifies a row or feature object within ArcGIS, values in this field must always be unique and not null. ArcGIS does not enforce the uniqueness of values in the unique identifier field used in a query layer or database table. The user must ensure values in this field meet the requirements.

When adding a database table by dragging it from the Catalog pane to the map in ArcGIS Pro, ArcGIS uses the first not-null field as the unique identifier field or the ObjectID field by default. However, a not-null field with non-unique values may cause inconsistent results when performing queries on the database table.

Procedure

Add the database table by creating a query layer in the map instead of dragging the database table from the Catalog pane to the map. Select the field(s) in the database table to be used as the ObjectID field. To add a query layer and select the field(s) as the ObjectID field, follow the steps below:

  1. With the project open, click Add Data and click Query Layer.
  2. In the New Query Layer dialog box, select the connected database where the table is stored from the Connection drop-down list.
Note:
If the connection does not exist in the project, select the new database connection button The new database connection button. and create a new connection to the database where the table is stored. For more information on database connections, refer to ArcGIS Pro: Database connections in ArcGIS Pro.
  1. Under List of Tables, select the database table.
  2. Click Validate. Once the database table is validated, click Next.
  3. Under Unique Identifier Field(s), check the field(s) to be the unique identifier fields(s).
  4. Click Finish. A query layer is created with the selected unique identifier field(s) as the ObjectID field.

Article ID:000018551

Software:
  • ArcGIS Pro 2 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic