SQL Script runs successfully but changes not visible in Geodatabase Version

2018
13
Jump to solution
09-27-2017 08:34 AM
AdelaideZumwalt1
Occasional Contributor II

SQL Script runs successfully but the changes are not visible in the geodatabase. The version gets created successfully but it seems like the version is either not saved or something else is going on...

EXEC dbo.create_version 'dbo.DEFAULT', 'WMMtoESRI', 2, 1, 'This version contains data pushed from WMM to ESRI';
EXEC dbo.set_current_version 'WMMtoESRI';
EXEC dbo.edit_version 'WMMtoESRI', 1;
BEGIN TRANSACTION
UPDATE ElectricNetwork.dbo.Regulators
SET esPhasing = WMM_Export.dbo.REGULATOR.wmPhasing
FROM WMM_Export.dbo.REGULATOR
WHERE
ElectricNetwork.dbo.Regulators.GUID=WMM_Export.dbo.REGULATOR.wmextVoltageRegulator__GUID_ESR
COMMIT;
EXEC dbo.edit_version 'WMMtoESRI', 2;

Thank you!

0 Kudos
13 Replies
Asrujit_SenGupta
MVP Regular Contributor

Well, only thing I can think of is that I hope the join is valid and has some records matching...

I will try to test with a sample data at my end whenever I have some time to test this and get back..

0 Kudos
Asrujit_SenGupta
MVP Regular Contributor

Well, I tried with sample data and it worked for me. Make sure:

1. There are records matching for the Join that you are creating, for the Update to happen (I know this is obvious, but still confirm)

2. You are checking the correct version in ArcMap\ArcCatalog for the updates after executing the SQL.

0 Kudos
AdelaideZumwalt1
Occasional Contributor II

Thank you Asrujit SenGupta! It was an issue with the records matching. Now that I sorted that out it works perfectly. Thank you so much for your time!! 

Addie

George_Thompson
Esri Frequent Contributor