ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Unique identifier fields

All layers in ArcGIS—including query layers, layers from geodatabases, and layers from databases—require a unique identifier.

If you define a query layer on a single geodatabase table or feature class, use the ObjectID field as the unique identifier field.

In most cases, though, you create query layers to access feature classes and tables in a database or drag a database layer directly into a map in an ArcGIS Desktop client. It is standard practice for database tables to contain a unique identifier field; therefore, your database tables likely already contain a field you can use as a unique identifier. If so, ArcMap will detect the qualifying field and set it as the unique identifier.

To use a field as a unique identifier in ArcGIS desktop apps, the field must be not null, contain unique values, and be one of the following data types:

  • Integer (positive values only)
  • String
  • GUID
  • Date

Values in the field must always be unique and not null. It is your responsibility to guarantee that values in this field meet these requirements.

Note:

You will receive an error if ArcGIS encounters a null value, but ArcGIS does not enforce the uniqueness of values in the unique identifier field used in a query layer or database table. If ArcGIS encounters a nonunique value, no error is returned; however, you may see inconsistent results in selection sets or other queries in ArcGIS.

If you want to publish the query layer in a feature layer (a feature service) that references the registered data store, the ID must be a single, not null, unique, autoincrementing integer field.

If ArcGIS cannot detect a qualifying unique identifier, you will be prompted to choose a field or fields to use when you drag a database table into ArcMap or when you validate a new query layer definition. In this example, ArcGIS could not find an integer, not-null field to use for a unique identifier. You must choose a field or combination of fields that you know is not null and unique to be used as a unique identifier for the rows in the table.

Choose a field or fields to be used as the unique ID.

If a qualifying field is present, ArcGIS sets the first not-null field it finds as the unique identifier field by default when you drag a database table from the Catalog tree and place it in ArcMap or validate a query layer definition. This is often an adequate value to use as the unique identifier field, but you can choose another qualifying field or fields from the Unique Identifier Field(s) list to be used instead. If you want to choose your own unique identifier, you can modify the query layer.

Related topics

  • Unique identifier fields in database tables
  • What is an ObjectID?

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal