Problem editing versioned data in SQL Server using multiversioned views and SQL

581
3
11-10-2011 07:40 AM
JohnLove
New Contributor
Hello,

I am attempting to update a versioned sde table using the following steps in T SQL.

EXEC dbo.set_current_version 'dbo.DEFAULT';
EXEC dbo.edit_version 'dbo.DEFAULT',1 ;
Delete from dbo.code_mv;      
EXEC dbo.edit_version 'dbo.DEFAULT', 2;

I'm using a multiversioned view as described at this ArcGIS Resource Center page: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/in_SQL_Server/006z0000001r000000/

Except I want to delete all records and insert all new ones into the DEFAULT view. The problem is that the table upon which the multiversioned view is based is not being updated after the above steps are completed. The View is updated, but not the table. Step 8 from the web page above indicates that a post and reconcile must be performed using ArcGIS Desktop.

Can anyone tell me how to get the data from the multiversioned view to the sde table using SQL or .Net?

Thanks,

John
0 Kudos
3 Replies
TomBrown
New Contributor
John

What release of ArcGIS are you using?

Any time you edit a versioned view, be it the DEFAULT version or a named version (that is then reconciled and posted to the DEFAULT version), the geodatabase must be compressed to move the rows from the delta tables to the base table.

Good luck.
0 Kudos
JohnLove
New Contributor
I'm using the latest. 10.0, Service Pack 3.

I found another issue. When creating a multiversioned view, the sde command "sdetable -o create_mv_view" , it creates the view and among other things, it also adds three triggers named v32_delete, v32_insert and v32_update. These triggers contain a call to the stored procedure SDE_get_globals. This stored procedure doesn't exist. At least in my two running SDE databases. When ever I attempt to insert into the multiversioned view, I get an error that says cannot find stored procedure  <database>.<schema>.SDE_get_globals.

Has anyone else created multiversioned views and if so, do you have this stored procedure?
0 Kudos
Jean-EricBaribeau
New Contributor
Hi,

I had the same problem and I manage to find why. I executed the  "sdetable -o create_mv_view" command with an ArcSDE 10 on an ArcSDE 9.3.1 Database. To correct the situation I have done an "sdetable -o delete_mv_view" with Version 10 and "sdetable -o create_mv_view" with version 9.3.1 and after everything was fine.

JEB
0 Kudos