<?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 How can I update a surrogate key with MSSQL in Talend, by using ELT components? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-can-I-update-a-surrogate-key-with-MSSQL-in-Talend-by-using/m-p/2329572#M98752</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as there is no ELT component for MSSQL to update a surrogate key with SCD, I need to find another solution for updating this key. Already, I insert a surrogate key by using a 'INT IDENTIFY' column in the database. My question is: How can I update a surrogate key with MSSQL in Talend, by using ELT components? My method below might be the wrong approach..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzTTAA1.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141665iC8FE5377082D9A85/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzTTAA1.png" alt="0693p00000ATzTTAA1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzWDAA1.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149246i556273A54A8CA14D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzWDAA1.png" alt="0693p00000ATzWDAA1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzW8AAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134216i0F17059E424B291A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzW8AAL.png" alt="0693p00000ATzW8AAL.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzVtAAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131938iF27CC07A4231FD28/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzVtAAL.png" alt="0693p00000ATzVtAAL.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzU7AAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147837i27CD16321671E788/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzU7AAL.png" alt="0693p00000ATzU7AAL.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The pictures show what I have tried. I insert a surrogate key in table2 (the column is not included, as it is inserted automatically in the database as another column). The problem is to update this key. I try to update the SK in tELTMSSqlOutput_2, but this error occurs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserting with :&amp;nbsp;&lt;/P&gt;&lt;P&gt;INSERT INTO EDW.Dimension_Bilagstype(bilagstype_kode,bilagstype_tekst,etl_modified_date,etl_job_name)&amp;nbsp;(SELECT ODS.IBS_Bilagstype.bilagstype, ODS.IBS_Bilagstype.beskrivelse, getdate(), 'job_EDW_Dimension_Bilagstype' FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype ) WHERE EDW.sk_bilagstype is null)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; 28 rows inserted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updating with :&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE EDW.Dimension_Bilagstype SET bilagstype_kode=(SELECT ODS.IBS_Bilagstype.bilagstype FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype )),bilagstype_tekst=(SELECT&amp;nbsp;ODS.IBS_Bilagstype.beskrivelse FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype )),etl_modified_date=(SELECT&amp;nbsp;getdate() FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype )),etl_job_name=(SELECT&amp;nbsp;'job_EDW_Dimension_Bilagstype' FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype ))&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[FATAL]: talend_okonomi.job_edw_dimension_bilagstype_0_1.job_EDW_Dimension_Bilagstype - tELTMSSqlOutput_2 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &amp;lt;, &amp;lt;= , &amp;gt;, &amp;gt;= or when the subquery is used as an expression.&lt;/P&gt;&lt;P&gt;com.microsoft.sqlserver.jdbc.SQLServerException: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &amp;lt;, &amp;lt;= , &amp;gt;, &amp;gt;= or when the subquery is used as an expression.&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1632)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:602)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:524)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7418)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3274)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:247)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:222)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:473)&lt;/P&gt;&lt;P&gt;	at talend_okonomi.job_edw_dimension_bilagstype_0_1.job_EDW_Dimension_Bilagstype.tELTMSSqlMap_1Process(job_EDW_Dimension_Bilagstype.java:12996)&lt;/P&gt;&lt;P&gt;	at talend_okonomi.job_edw_dimension_bilagstype_0_1.job_EDW_Dimension_Bilagstype.runJobInTOS(job_EDW_Dimension_Bilagstype.java:17659)&lt;/P&gt;&lt;P&gt;	at talend_okonomi.job_edw_dimension_bilagstype_0_1.job_EDW_Dimension_Bilagstype.main(job_EDW_Dimension_Bilagstype.java:16965)&lt;/P&gt;&lt;P&gt;[statistics] disconnected&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:29:53 GMT</pubDate>
    <dc:creator>HSHalvorsen</dc:creator>
    <dc:date>2024-11-16T00:29:53Z</dc:date>
    <item>
      <title>How can I update a surrogate key with MSSQL in Talend, by using ELT components?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-can-I-update-a-surrogate-key-with-MSSQL-in-Talend-by-using/m-p/2329572#M98752</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as there is no ELT component for MSSQL to update a surrogate key with SCD, I need to find another solution for updating this key. Already, I insert a surrogate key by using a 'INT IDENTIFY' column in the database. My question is: How can I update a surrogate key with MSSQL in Talend, by using ELT components? My method below might be the wrong approach..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzTTAA1.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141665iC8FE5377082D9A85/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzTTAA1.png" alt="0693p00000ATzTTAA1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzWDAA1.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149246i556273A54A8CA14D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzWDAA1.png" alt="0693p00000ATzWDAA1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzW8AAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134216i0F17059E424B291A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzW8AAL.png" alt="0693p00000ATzW8AAL.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzVtAAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131938iF27CC07A4231FD28/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzVtAAL.png" alt="0693p00000ATzVtAAL.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000ATzU7AAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147837i27CD16321671E788/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000ATzU7AAL.png" alt="0693p00000ATzU7AAL.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The pictures show what I have tried. I insert a surrogate key in table2 (the column is not included, as it is inserted automatically in the database as another column). The problem is to update this key. I try to update the SK in tELTMSSqlOutput_2, but this error occurs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserting with :&amp;nbsp;&lt;/P&gt;&lt;P&gt;INSERT INTO EDW.Dimension_Bilagstype(bilagstype_kode,bilagstype_tekst,etl_modified_date,etl_job_name)&amp;nbsp;(SELECT ODS.IBS_Bilagstype.bilagstype, ODS.IBS_Bilagstype.beskrivelse, getdate(), 'job_EDW_Dimension_Bilagstype' FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype ) WHERE EDW.sk_bilagstype is null)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; 28 rows inserted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updating with :&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE EDW.Dimension_Bilagstype SET bilagstype_kode=(SELECT ODS.IBS_Bilagstype.bilagstype FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype )),bilagstype_tekst=(SELECT&amp;nbsp;ODS.IBS_Bilagstype.beskrivelse FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype )),etl_modified_date=(SELECT&amp;nbsp;getdate() FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype )),etl_job_name=(SELECT&amp;nbsp;'job_EDW_Dimension_Bilagstype' FROM&amp;nbsp;ODS.IBS_Bilagstype LEFT OUTER JOIN&amp;nbsp;EDW.Dimension_Bilagstype EDW ON(&amp;nbsp;EDW.bilagstype_kode = ODS.IBS_Bilagstype.bilagstype ))&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[FATAL]: talend_okonomi.job_edw_dimension_bilagstype_0_1.job_EDW_Dimension_Bilagstype - tELTMSSqlOutput_2 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &amp;lt;, &amp;lt;= , &amp;gt;, &amp;gt;= or when the subquery is used as an expression.&lt;/P&gt;&lt;P&gt;com.microsoft.sqlserver.jdbc.SQLServerException: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &amp;lt;, &amp;lt;= , &amp;gt;, &amp;gt;= or when the subquery is used as an expression.&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1632)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:602)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:524)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7418)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3274)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:247)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:222)&lt;/P&gt;&lt;P&gt;	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:473)&lt;/P&gt;&lt;P&gt;	at talend_okonomi.job_edw_dimension_bilagstype_0_1.job_EDW_Dimension_Bilagstype.tELTMSSqlMap_1Process(job_EDW_Dimension_Bilagstype.java:12996)&lt;/P&gt;&lt;P&gt;	at talend_okonomi.job_edw_dimension_bilagstype_0_1.job_EDW_Dimension_Bilagstype.runJobInTOS(job_EDW_Dimension_Bilagstype.java:17659)&lt;/P&gt;&lt;P&gt;	at talend_okonomi.job_edw_dimension_bilagstype_0_1.job_EDW_Dimension_Bilagstype.main(job_EDW_Dimension_Bilagstype.java:16965)&lt;/P&gt;&lt;P&gt;[statistics] disconnected&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:29:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-can-I-update-a-surrogate-key-with-MSSQL-in-Talend-by-using/m-p/2329572#M98752</guid>
      <dc:creator>HSHalvorsen</dc:creator>
      <dc:date>2024-11-16T00:29:53Z</dc:date>
    </item>
  </channel>
</rss>

