6

I want to have a field with autonumbering in ArcGIS.

I have a versioned ArcSDE for SQL Server geodatabase.

Thus, using the identity seed attribute in the SQL Server is not an option.

Is it not possible to autonumber your own columns in ArcSDE?

2 Answers 2

3

Classic problem :(

I can give you a db-specific solution:

The downside of this approach is that if rows get created in child versions and subsequently not posted, you will have gaps in the numbers. You can listen to post events and reassign ids if this is really an issue though.

Until ESRI has a native sequence type, this is the one of the few options you have.

4
  • Ragi, any tips for SQL Server 2008? It looks like I'm going to have to manage the auto-increment ID on the client side, which seems a bit problematic. (I'm working with the javascript API) Dec 6, 2012 at 23:26
  • 1
    You cannot handle it 100% in the client. Because unless you are managing the ids on the server (by using something like sequences), you will encounter concurrency problems. Expose the sequences through web services if you need to manipulate stuff using the js API. Dec 7, 2012 at 7:18
  • Okay, thanks for the input, that should work. I was afraid that I was asking for trouble heading down that path. Dec 7, 2012 at 18:07
  • Of course, you could also create FeatureClass Extensions and handle it there so it would be transparent to the js side. The point is that you will need server-side code to do this one way or another. Dec 7, 2012 at 21:17
0

I don't know if the ArcSDE part can do it (a quick search suggests no), but your SQL Server database should be able to auto-increment/auto-number a column of your choice in the data if you want. You can find more information here on how to do it - http://howtoideas.net/how-to-create-auto-increment-column-in-a-sql-server-table

1
  • I tried, but because my sde is versioned, data is stored in both business tables, add tables and delete tables. Further, if I try to alter field definitions by with auto-incrementing (identity seed) in eiher table, ArcMap will produce exotic some errors, when I try to create new features.
    – Morten
    Oct 17, 2012 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.