Solved! Go to Solution.
Sounds like you need multi-versioned views to do this. However, I don't think you can have multi-version views on non-saved edits. Edits in ArcSDE get written to the delta tables. However, in some cases the features may already be deleted, some changed, others created, the changes don't make it to the base tables until a compress. Editing geodatabase data using sql is kind of a gamble, it is fast and works great until it corrupts your entire database. There are ways to make bulk updates faster, (updatecursor, Itablewrite, loadonly) but none of them really come close to using an sql update. If this is a once in a while kind of update, I suggest, closing all edit sessions, reconciling all outstanding versions, compressing the table or featureclass, then running the sql script.
Andy,
ExecuteSQL expressions will only work on the saved state and wont see the editor delta tables within an edit session. You'll have to use ArcObjects.
You can execute sql expressions against multiversioned views to get access to versioned data. Please read SQL access to geodatabase data and its associated topics for the workflow. You'll need to execute a stored procedure to change the version before running your sql statement.
Caveat emptor, I have done this via a sql client in the past, and it works well, but I haven't tried it through the ExecuteSQL method.
If I have a workspace that points to a specific version e.g. the edit workspace pointing to "version A" and I use executeSQL on that workspace does it hit that "version A" or does it hit the default version with the update?
It will hit the base tables. The workspace reference is just used as a handle to the DBMS. The original intent for the method was just to submit SQL commands at the database level so you could conveniently do things like turn tracing on etc.