Add an incremental, unique ID

9565
21
01-02-2020 09:21 AM
JoeBorgione
MVP Emeritus

This is a topic that's been around for as long as I can remember.  The attribute assistant provided a couple methods to do this: autonumber, generate id, and there us a tool called Add Incrementing ID field but it is limited to database tables, not GEOdatabase tables; if an object id is present, the tool won't work.

Is there a method or tool available in ArcGIS Pro 2.4.3 that will autoincrement a field in an enterprise geodatabase table and/or feature class?

That should just about do it....
Tags (1)
21 Replies
JoeBorgione
MVP Emeritus

Desktop as in ArcMap/ArcCatalog?   Attribute assistant.

Attribute rules is a Pro thing only; might be time to migrate?

That should just about do it....
0 Kudos
by Anonymous User
Not applicable

You're right. Just adding to list of reasons to upgrade...

For the purposes of this thread (and those who are still using Desktop), Attribute Assistant is definitely the way to go. I've spent a few hours configuring it and now I'm up and running. 

Thanks, and sorry for hijacking the thread!

0 Kudos
JoeBorgione
MVP Emeritus

I've used attribute assistant a bunch, but since January of this year, I'm totally ArcGIS Pro, and while it has it's ups and downs, I don't really miss ArcMap... (I don't think you can hijack a thread, really; at least you got a solution out of the deal!)

That should just about do it....
0 Kudos
TL2
by
Occasional Contributor III

This is great, but it doesn't seem to work correctly when creating records in a Web App or Survey123.  It increments by 2.  Posting from the server seems to make two inserts causing the double incremental value.  

Anyone figure this out?

0 Kudos
CraigSwadner
Occasional Contributor

This doesn’t effect survey123, however we have multiple software apps that touch our sde database and we created a db trigger to maintain our ids.

Craig Swadner (GIS Coordinator)

City of Cape Coral

1015 Cultural Park Blvd.

Cape Coral, Fl 33990

Did you know the best way to report issues to ITS is to use the Service Desk system? This will ensure someone in ITS gets your request and allows us to track the progress. Please enter all your issues and/or questions by clicking https://breeze.cape.capecoral.net

0 Kudos
TL2
by
Occasional Contributor III

Have you tested with S123?  I have not had luck with a trigger producing incremental values with S123.  I currently have to use a Trigger & Job for my incremental values.

SQL Trigger on table causes CODE 500 Error. 

SQL Trigger on featurclass in SQL SERVER 

0 Kudos
CraigSwadner
Occasional Contributor

I haven’t however any gis application that uses versioning should work fine, ArcMap, Pro and our webapps work just fine. I don’t think survey123 works with any kind of sql db to my knowledge, probably why we don’t use it much at all.

Craig Swadner (GIS Coordinator)

City of Cape Coral

1015 Cultural Park Blvd.

Cape Coral, Fl 33990

Did you know the best way to report issues to ITS is to use the Service Desk system? This will ensure someone in ITS gets your request and allows us to track the progress. Please enter all your issues and/or questions by clicking https://breeze.cape.capecoral.net

0 Kudos
GustavoHenriquedeOliveira
New Contributor

Hello @JoeBorgione ,

Thank you for answer! I can solved my problem using this solution.

Congrats.

0 Kudos
RayburnClipper
New Contributor III

My GDB is in Oracle, I use a trigger to insert a unique id based on the sequence.  I discovered this post because there are some odd things happening to my unique ids now. I am getting duplicates , nulls. So I started looking to see what others are doing and I am very surprised that ESRI doesn't have something that will create an auto-incrementing id field.  Also curious about what others are doing to create their auto-incrementing id's.  Having a unique id seems to be a pretty important thing.

Government - If you think the problems we create are bad, just wait until you see our solutions.
0 Kudos
GretaParis
New Contributor II

I successfully created incrementing attribute tables for the layers within my map thanks to this thread, so thank you! I am currently trying to publish my map as a feature layer to my company's Portal and I keep getting errors saying that the service could not be created. I was wondering if creating the incremental attribute tables might be interfering with my ability to publish - has anyone else experienced this problem?

0 Kudos