There are two geoprocessing tools in the Geodatabase Admin tool box: Create and Delete Database Sequence. You can get access to a sequence's properties using arcpy.ListDatabaseSquences.
The database sequence help page states: DatabaseSequence objects cannot be initialized directly and the properties table shows all the properties as read only.
I guess the only way to alter an existing database sequence is to delete it and recreate it. It would be cool if an existing one could be altered or modified.
You can make changes to the sequence and increase for example the cache sequence values in the RDMBS using SQL.
Yes, in a file gdb you have no option, you have to use the ArcCatalog tools.
Where do the sequences exist in the SQL DB?
Thanks for the idea @JoeBorgione
We're interested in knowing more about this. Could you share some example workflows you use that would benefit from being able to alter the database sequence?
@SSWoodward I retired back in December 2022 and haven’t even thought about database sequences since then. I have landed a lot of fish however in that time…
All seriousness aside, let’s say you get a large influx of data you need to append into your database and with it comes a need to alter the sequence in some fashion. In my (former) case, that could come as an annexation into a city
In a SQL Server database you can back door that but not in the case of the FGDB.
If you need me, I’ll be on the river…
I wonder if there are any updates on this front.
Also, would it be possible to utilize a sequence from another EGDB?
@SSWoodward @MarceloMarques @JoeBorgione
@TitusGian - Geodatabase sequences are unique per featureclass and table, so it cannot be used for anything else, and avoid editing or modifing the sequence manually directly in the rdbms, this can cause issues if you do not know what you are doing is correct, you might end up with issues with objectid's.
Does anyone know of a way to delete all the sequences in an enterprise geodatabase at once? I am having to refresh all of the data in a geodatabase without recreating it but I can't do that without deleting all the sequences (and attribute rules). Is there a python script that could iterate through them and delete them?
Afternoon @MatthewStull1 ,
Have you tried something like:
workspace = <workspace path>
for seq in arcpy.da.ListDatabaseSequences(workspace):
arcpy.management.DeleteDatabaseSequence(workspace, seq.name)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.