Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer
    
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) –  Ryan Twilley Dec 6 '12 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. –  Ragi Yaser Burhum Dec 7 '12 at 7:18
    
Okay, thanks for the input, that should work. I was afraid that I was asking for trouble heading down that path. –  Ryan Twilley Dec 7 '12 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. –  Ragi Yaser Burhum Dec 7 '12 at 21:17
add comment

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

share|improve this answer
    
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 '12 at 13:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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