AnsweredAssumed Answered

SQL Error: "Not currently editing a version, cannot stop edit."

Question asked by AJZumwalt9 on Jan 24, 2018
Latest reply on Feb 22, 2018 by AJZumwalt9

I used this script for a couple months on another database but can't seem to get it to work on the new database. I keep running into the following error: "Not currently editing a version, cannot stop edit." even though my step specifically starts and stops the edit session. What am I missing? The version is being created, I can see it in ArcMap:


EXEC dbo.create_version 'dbo.DEFAULT', 'WMMUpdate', 1, 1, 'This version contains data pushed from WMMExport to ElectricModel';
EXEC dbo.set_current_version 'WMMUpdate';
EXEC dbo.edit_version 'WMMUpdate', 1;


MERGE ElectricModel.dbo.Transformer_evw
ON ElectricModel.dbo.Transformer_evw.GUID_WMM = WMMExport.dbo.TRANSFORMER.wm_ElementGuid
UPDATE SET ElectricModel.dbo.Transformer_evw.esElementName= WMMExport.dbo.TRANSFORMER.wmElementName;


EXEC dbo.edit_version 'WMMUpdate', 2;