<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: sql violation of unique key constraint in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294629#M16889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you create your version? Was it using a script or through ArcMap? Also - how old is your version?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Sep 2018 20:15:44 GMT</pubDate>
    <dc:creator>AdelaideZumwalt1</dc:creator>
    <dc:date>2018-09-20T20:15:44Z</dc:date>
    <item>
      <title>sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294621#M16881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I run the following script, which has run successfully for me on a number of other tables I get the following error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Violation of UNIQUE KEY constraint 'versions_uk'. Cannot insert duplicate key in object 'dbo.SDE_versions'. The duplicate key value is (Poles, DBO).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The primary key for the Poles table is the ObjectID.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;EXEC dbo.create_version 'dbo.DEFAULT', 'Poles', 1, 1, 'This version contains data pushed from WMM to ESRI';&lt;BR /&gt;EXEC dbo.set_current_version 'Poles';&lt;BR /&gt;EXEC dbo.edit_version 'Poles', 1;&lt;BR /&gt;MERGE ElectricNetwork.dbo.POLE_evw&lt;BR /&gt;USING WMM_Export.dbo.Pole&lt;BR /&gt;ON ElectricNetwork.dbo.POLE_evw.esElementName = WMM_Export.dbo.Pole.wmElementName&lt;BR /&gt;WHEN MATCHED THEN&lt;BR /&gt;UPDATE SET ElectricNetwork.dbo.POLE_evw.GUID_WMM= WMM_Export.dbo.Pole.wm_ElementGuid;&lt;BR /&gt;EXEC dbo.edit_version 'Poles', 2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Oct 2017 23:13:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294621#M16881</guid>
      <dc:creator>AdelaideZumwalt1</dc:creator>
      <dc:date>2017-10-03T23:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294622#M16882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/edit-versioned-data-using-sql-sqlserver.htm#ESRI_SECTION1_29C75D6AEDCA4C0E91B8350009E53231" title="http://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/edit-versioned-data-using-sql-sqlserver.htm#ESRI_SECTION1_29C75D6AEDCA4C0E91B8350009E53231"&gt;Edit versioned data in SQL Server using SQL—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;error or you may say the Warning is due&amp;nbsp;the creation of the Version named 'Poles' as there is already a Version with the same name present in the geodatabase&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;EXEC dbo.create_version 'dbo.DEFAULT', 'Poles', &lt;STRONG&gt;1&lt;/STRONG&gt;, 1, 'This version contains data pushed from WMM to ESRI';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL class="" style="color: #4d4d4d; background-color: #fefefe; font-size: 0.875em; margin-bottom: 1.5em;"&gt;&lt;LI style="font-size: 0.875rem; padding-left: 1em;"&gt;&amp;lt;name_rule&amp;gt; indicates whether the name specified for the version should be taken as given (2), or a &lt;STRONG&gt;unique name should be created when a duplicate name is specified&lt;/STRONG&gt; (1).&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Even though you get that error\warning, a new Version is created in the Geodatabase. Check the screenshot below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/375829_test1.PNG" style="width: 789px; height: 461px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2017 09:11:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294622#M16882</guid>
      <dc:creator>Asrujit_SenGupta</dc:creator>
      <dc:date>2017-10-04T09:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294623#M16883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that appeared to be the problem. Thank you! Maybe you can help me with my next question too. Once I deleted the existing versions and re-ran it I got this error:&lt;/P&gt;&lt;P&gt;Invalid object name 'ElectricNetwork.dbo.POLE_evw' The object name is correct and named correctly. Is the "_evw" part incorrect?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:06:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294623#M16883</guid>
      <dc:creator>AdelaideZumwalt1</dc:creator>
      <dc:date>2017-10-04T15:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294624#M16884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the POLE feature class registered as versioned? If yes, confirm the Versioned View name from SQL Server Management Studio or in Feature Class properties in ArcCatalog.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:09:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294624#M16884</guid>
      <dc:creator>Asrujit_SenGupta</dc:creator>
      <dc:date>2017-10-04T15:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294625#M16885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;I found the issue... for some reason poles is plural when versioned (This must be because I changed the feature class name&amp;nbsp;to singular after registering it as versioned. Thank you!!&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/375835_pastedImage_2.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:22:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294625#M16885</guid>
      <dc:creator>AdelaideZumwalt1</dc:creator>
      <dc:date>2017-10-04T15:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294626#M16886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another question, it ran fine on a couple of my tables, but on another I got this error: Violation of PRIMARY KEY constraint 'a26_rowid_ix1' Cannot insert duplicate key in object 'dbo.a26.' The duplicate key value is '1172404, 658'.... The OBJECTID is the primary key in the sql table and I'm not using it as part of the join...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXEC dbo.create_version 'dbo.DEFAULT', 'Assembliesb', 1, 1, 'This version contains data pushed from WMM to ESRI';&lt;BR /&gt;EXEC dbo.set_current_version 'Assembliesb';&lt;BR /&gt;EXEC dbo.edit_version 'Assembliesb', 1;&lt;BR /&gt;MERGE ElectricNetwork.dbo.Assemblies_evw&lt;BR /&gt;USING ElectricNetwork.dbo.Poles_evw&lt;BR /&gt;ON ElectricNetwork.dbo.Assemblies_evw.MapPointName = ElectricNetwork.dbo.Poles_evw.esElementName&lt;BR /&gt;WHEN MATCHED THEN&lt;BR /&gt;UPDATE SET ElectricNetwork.dbo.Assemblies_evw.GUID= ElectricNetwork.dbo.Poles_evw.GlobalID;&lt;BR /&gt;EXEC dbo.edit_version 'Assembliesb', 2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:41:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294626#M16886</guid>
      <dc:creator>AdelaideZumwalt1</dc:creator>
      <dc:date>2017-10-04T15:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294627#M16887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing it's because there is a duplicate "ElementName" somewhere in the table that is tripping it up. Is there any way to bypass this? Or skip that particular record and move on without crashing the entire script?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:50:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294627#M16887</guid>
      <dc:creator>AdelaideZumwalt1</dc:creator>
      <dc:date>2017-10-04T15:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294628#M16888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/230847"&gt;Asrujit SenGupta&lt;/A&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting this error from ArcMAP when I try to reconcile my edits!&amp;nbsp; also I noticed that the &lt;STRONG&gt;labels&lt;/STRONG&gt;&amp;nbsp;in "NodesLocation" feature class -which the error references- are duplicated but the features are not !&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what might be the source of this issue, I am just doing simple edits on the features from ArcMAP.&lt;/P&gt;&lt;P&gt;Geodatabase version is 10.5.0&lt;/P&gt;&lt;P&gt;ArcMAP 10.5.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="422547" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/422547_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ahmad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 19:23:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294628#M16888</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2018-09-20T19:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294629#M16889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you create your version? Was it using a script or through ArcMap? Also - how old is your version?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 20:15:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294629#M16889</guid>
      <dc:creator>AdelaideZumwalt1</dc:creator>
      <dc:date>2018-09-20T20:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294630#M16890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to run the Diagnose and Repair tools to fix this:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/diagnose-version-tables.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/diagnose-version-tables.htm"&gt;Diagnose Version Tables—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/repair-version-tables.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/repair-version-tables.htm"&gt;Repair Version Tables—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember to backup before running the tools.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 20:26:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294630#M16890</guid>
      <dc:creator>Asrujit_SenGupta</dc:creator>
      <dc:date>2018-09-20T20:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294631#M16891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Asrujit,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually I do run those 2 tools, sometimes I get that there is multiversioned tables had orphaned and sometimes I get nothing orphaned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;this issue keeps happening&amp;nbsp; all the day and its hard to keep disconnecting all users to apply diagnose and repair. I am looking for a method to prevent this from happening. any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ahmad&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2018 17:05:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294631#M16891</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2018-09-21T17:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: sql violation of unique key constraint</title>
      <link>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294632#M16892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Adelaide,&lt;/P&gt;&lt;P&gt;My versions are created from ArcMap, and most of them are less that a day, from my testing I found that even if you created the version when you start working (less than 1 hour age) you will still get this error!&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2018 17:08:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sql-violation-of-unique-key-constraint/m-p/294632#M16892</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2018-09-21T17:08:03Z</dc:date>
    </item>
  </channel>
</rss>

