Arc 9.3.1SQL Server 2008 All,Wondering if I can get some help on this. I've spent the last few days scouring the message boards, help files and documents trying to get a handle on compressing our SDE database back to State ID 0.I've followed everything that ESRI and other users have provided:1. Reconcile and Post all versions (in this case not necessary since working in .DEFAULT)2. Ensure no users are connected to the database3. Delete any and all versions (to include all replicas (to take that out of the equation))4. Analyze Feature Datasets and Feature Classes5. Compress6. Analyze Feature Datasets and Feature ClassesSo fine, ESRI isn't perfect and I'm still not showing State ID 0 (I can safely say that it's not because of a corrupted state tree, unless it's prone to corrupt after a single edit session), so I sit down with our SQL DBA and we discuss other solutions for this problem. The obvious answer is to unregister the data as versioned, this removes the Delta tables and obviously we go back to State ID 0. To ESRI's credit they've included the ability to compress edits to base while doing this, super, problem solved. Now we just need to automate this process.A little looking and presto, problem solved:import arcgisscripting
gp = arcgisscripting.create(9.3)
gp.workspace = "Database Connections\My Database Connection String"
gp.toolbox = "management"
gp.unregisterasversioned("Feature Dataset Name", "KEEP_EDIT", "COMPRESS_DEFAULT")
... sadness... problem not solved...The problem comes with the keep_edit portion. My understanding of this is that by telling it to "KEEP_EDIT" it's going to "save" the Delta tables, then look at the compress_default parameter and, if "COMPRESS_DEFAULT" is used, then compress the Deltas into the Base table. This does not happen though. I get: ExecuteError: Error 000316: The following datasets contain edits: 'Feature Class Name'Failed to execute (UnregisterAsVersioned).This happens even after I've compressed the database via the steps listed above, and it seems that it shouldn't matter either way because the syntax should do this for me.I cannot find a single help/bug report/forum post addressing this.Now, if we use the ArcCatalog supplied ArcObjects 'Unregister as Versioned' tool, it works great, no issues, even if I haven't compressed the database, since the tool does this for me.So my question is what am I doing wrong or is there a known issue with the scripting syntax?Any help on this would be greatly appreciated.