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.
I keep getting the error message "Could not open SDE workspace." when I run this code:
import arcpy
arcpy.env.workspace = r"R:\GIS_Ongoing\Cityworks\Cityworks GIS Editing Environment\Cityworks Catalog ONLY\Cityworks Development matts.sde"
seqwork = r"R:\GIS_Ongoing\Cityworks\Cityworks GIS Editing Environment\Cityworks Catalog ONLY\Cityworks Development matts.sde"
sq_list = arcpy.da.ListDatabaseSequences(seqwork)
#attribue rule sequences
for seq in sq_list:
arcpy.management.DeleteDatabaseSequence(seq)
I haven't done python scripting for a while so I'm just trying to make this work. I'm using Pro 3.1
Hard to say.
Check to make sure you have the correct access: Delete Database Sequence Doc
Does ListDatabaseSequences() work on its own for you?
@SSWoodward - If you're still looking for workflow examples, here is one I am in the middle of:
As a Solution Architect I need to be able to reset a sequence when my users are ready to switch from training and testing to 'live' work.
In our situation we do not have a dev instance of enterprise where users can test out new solutions. So quite often they are 'testing' in our live environment and then when they decide they are ready to start actually using the solution they want things reset. Admittedly, this is us catering to their need to have things like file numbers start at an 'clean' value like 10,000. From a data perspective it doesn't matter but users often care about things like that.
It would be very handy to have a tool that let us specify a new "last number used" value for the sequence. I can also see instances where this would be helpful for making landmarks in a sequence. For example, all numbers above 20,000 are after we [started doing something new].
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.