00166: Layer's ObjectID is not maintained by the database and the feature service is being published with Create capability enabled

Your layer has an ObjectID attribute of type integer, it is not database maintained, and the spatial database server (SDS) service you're attempting to publish has the Create operation enabled.

Solution

If users of this SDS service will be creating new features, you must have ObjectIDs that are database maintained. You can do this by using the Add Incrementing ID Field tool geoprocessing tool. 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.

If users of this SDS service will not be creating new features, disable the Create operation by navigating to the Feature Access tab of the Service Editor dialog box and unchecking the operation.

More information

The ObjectID field is maintained by ArcGIS and guarantees a unique ID for each row in a table. When you look at a table or a layer's attribute table, you will usually see the ObjectID field listed under the aliases of OID or ObjectID. Key functions, such as scrolling and displaying selection sets, depend on the presence of this field.

Learn more about ObjectID fields

Integer ObjectID attributes must be database maintained if the end user of the service will be creating additional features for this layer.

Learn more about authoring feature services for SDS

12/18/2014