<?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 Violation of PRIMARY KEY in tDBUpdate in MS SQL where duplicates not exists in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Violation-of-PRIMARY-KEY-in-tDBUpdate-in-MS-SQL-where-duplicates/m-p/2512561#M147397</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a subjob where i use a tMap to join two tables and where the output is connected to a tDBOutput. When I run the job I get an error on multiple lines&amp;nbsp;on the mentioned table:&lt;/P&gt;&lt;P class=""&gt;Violation of PRIMARY KEY constraint 'PK__Gods__FD36D7E647FE53B6'. Cannot insert duplicate key in object 'edw.Gods'. The duplicate key value is (333715, 1).&lt;/P&gt;&lt;P class=""&gt;[ERROR] 13:12:01 tso.initialload_all_tables_hogia_sql_server_0_1.InitialLoad_all_tables_Hogia_SQL_Server- tDBOutput_14 - Violation of PRIMARY KEY constraint 'PK__Gods__FD36D7E647FE53B6'. Cannot insert duplicate key in object 'edw.Gods'. The duplicate key value is (333715, 1).&lt;/P&gt;&lt;P&gt;On the tDBOutput the action on the table is "dropp table if exists and create" and action on data is "Insert". In the schema I have specified two columns as key. They are both key columns in the original source which also is a MS SQL data base.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EspenH_0-1743506210052.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179212i802D0D6CFEDA162A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EspenH_0-1743506210052.png" alt="EspenH_0-1743506210052.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have verified than the transactions where I get an error using both the primary keys are in fact unique in the source.&lt;/P&gt;&lt;P&gt;In the tDBOutput job I have referenced the data source by "use an existing connection". This is connected in a tPrejob and tDBConnection wit "Auto commit".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EspenH_1-1743506340869.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179215i5B776FB3C82AD759/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EspenH_1-1743506340869.png" alt="EspenH_1-1743506340869.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Do any of you Talend experts know why I get this error?&lt;/P&gt;</description>
    <pubDate>Tue, 01 Apr 2025 11:36:56 GMT</pubDate>
    <dc:creator>EspenH</dc:creator>
    <dc:date>2025-04-01T11:36:56Z</dc:date>
    <item>
      <title>Violation of PRIMARY KEY in tDBUpdate in MS SQL where duplicates not exists</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Violation-of-PRIMARY-KEY-in-tDBUpdate-in-MS-SQL-where-duplicates/m-p/2512561#M147397</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a subjob where i use a tMap to join two tables and where the output is connected to a tDBOutput. When I run the job I get an error on multiple lines&amp;nbsp;on the mentioned table:&lt;/P&gt;&lt;P class=""&gt;Violation of PRIMARY KEY constraint 'PK__Gods__FD36D7E647FE53B6'. Cannot insert duplicate key in object 'edw.Gods'. The duplicate key value is (333715, 1).&lt;/P&gt;&lt;P class=""&gt;[ERROR] 13:12:01 tso.initialload_all_tables_hogia_sql_server_0_1.InitialLoad_all_tables_Hogia_SQL_Server- tDBOutput_14 - Violation of PRIMARY KEY constraint 'PK__Gods__FD36D7E647FE53B6'. Cannot insert duplicate key in object 'edw.Gods'. The duplicate key value is (333715, 1).&lt;/P&gt;&lt;P&gt;On the tDBOutput the action on the table is "dropp table if exists and create" and action on data is "Insert". In the schema I have specified two columns as key. They are both key columns in the original source which also is a MS SQL data base.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EspenH_0-1743506210052.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179212i802D0D6CFEDA162A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EspenH_0-1743506210052.png" alt="EspenH_0-1743506210052.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have verified than the transactions where I get an error using both the primary keys are in fact unique in the source.&lt;/P&gt;&lt;P&gt;In the tDBOutput job I have referenced the data source by "use an existing connection". This is connected in a tPrejob and tDBConnection wit "Auto commit".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EspenH_1-1743506340869.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179215i5B776FB3C82AD759/image-size/medium?v=v2&amp;amp;px=400" role="button" title="EspenH_1-1743506340869.png" alt="EspenH_1-1743506340869.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Do any of you Talend experts know why I get this error?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 11:36:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Violation-of-PRIMARY-KEY-in-tDBUpdate-in-MS-SQL-where-duplicates/m-p/2512561#M147397</guid>
      <dc:creator>EspenH</dc:creator>
      <dc:date>2025-04-01T11:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Violation of PRIMARY KEY in tDBUpdate in MS SQL where duplicates not exists</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Violation-of-PRIMARY-KEY-in-tDBUpdate-in-MS-SQL-where-duplicates/m-p/2512565#M147398</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/293868"&gt;@EspenH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you show us the setup of your tMap ?&lt;/P&gt;&lt;P&gt;Also maybe try to replace the &lt;STRONG&gt;tDBOutput&lt;/STRONG&gt; with a &lt;STRONG&gt;tFileOutputDelimited&lt;/STRONG&gt; and try to see if there is any duplicate key in the file. Maybe you are generating duplicates by doing the join in the &lt;STRONG&gt;tMap&lt;/STRONG&gt; component.&lt;/P&gt;&lt;P&gt;- Quentin&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 11:45:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Violation-of-PRIMARY-KEY-in-tDBUpdate-in-MS-SQL-where-duplicates/m-p/2512565#M147398</guid>
      <dc:creator>quentin-vigne</dc:creator>
      <dc:date>2025-04-01T11:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Violation of PRIMARY KEY in tDBUpdate in MS SQL where duplicates not exists</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Violation-of-PRIMARY-KEY-in-tDBUpdate-in-MS-SQL-where-duplicates/m-p/2512576#M147400</link>
      <description>&lt;P&gt;Hi Quentin&lt;/P&gt;&lt;P&gt;Thank you for replying!&lt;/P&gt;&lt;P&gt;And thanks to your reply i started to go throug my setup. The input was not the straight source table, but another tMap where i created duplicates of the key. Arrrrrhhh...stupid...&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 12:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Violation-of-PRIMARY-KEY-in-tDBUpdate-in-MS-SQL-where-duplicates/m-p/2512576#M147400</guid>
      <dc:creator>EspenH</dc:creator>
      <dc:date>2025-04-01T12:26:21Z</dc:date>
    </item>
  </channel>
</rss>

