Select to view content in your preferred language

Auto-Increment Field within SDE

17002
32
07-08-2014 01:13 PM
mpboyle
Regular Contributor

Has anyone successfully implemented a way of auto-incrementing an integer field within a SDE (Sql Server) geodatabase?  If so, would you be willing to share your method with examples?

I'd like to have an integer field that increments anytime a feature is created (inserted) and not have to rely on scripts afterwards to populate the field.

Our current system is:

ArcSDE: 10.1 sp1

RDBMS: Sql Server 2008 R2

Thanks in advance!

32 Replies

Very impressive solutions presented here!  It definitely gets complicated when dealing with versioned data.

There is also this option, an arc tool to add an incrementing ID field in an enterprise geodatabase

Add Incrementing ID Field—Data Management toolbox | ArcGIS Desktop 

In Oracle and SQL server this tool performs the functions of creating a sequence and a trigger for you.

0 Kudos
mpboyle
Regular Contributor

This is a great tool, the only downside I see to it is that it can NOT be used on a table or feature classes registered with the geodatabase.  If using Sql Server (which we do), I don't believe you can specify a field with an identity property if using a standard table or feature class.

0 Kudos
MEDCGISAdmin
New Contributor

hello dear, I have the same task
I want to auto-update a field if any new feature added to the Editor version
for example :
I have a feature and I already update a field with certain code using SQL so I want to auto-complete the code updating in the same field once a new feature created

the code format to be OLU0001F --->> the only number to be incremented is 0001-0002-0003,...etc

0 Kudos