<?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: MS SQL Server Merge using ELT in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224099#M16946</link>
    <description>&lt;P&gt;Hi &lt;A href="https://community.qlik.com/s/profile/00539000004XsaeAAC"&gt;@xdshi&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Sorry for my quick non-informative question. Let me fix that.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What I'm trying to achieve is a very straight forward update all of TGT table from matching SRC table, which looks something like this:&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="SS-01.jpg" style="width: 625px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1dM.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156659i51FF033E4BC319B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1dM.jpg" alt="0683p000009M1dM.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The configuration inside the tELTMSSqlMap component looks like this:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SS-02.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1dR.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142284iBDE2A648E0E855B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1dR.jpg" alt="0683p000009M1dR.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SS-03.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1dW.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144853i62445BA85BC5765D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1dW.jpg" alt="0683p000009M1dW.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;When I run the job, it's creating a query like this:&lt;/P&gt; 
&lt;PRE&gt;Starting job testELTUpdate at 10:40 12/12/2018.
Updating with : 
UPDATE ETL.TGT SET PK=(SELECT SRC.PK  FROM  ETL.SRC SRC),STD_NAME=(SELECT  SRC.STD_NAME  FROM  ETL.SRC SRC),STD_NUM=(SELECT  SRC.STD_NUM  FROM  ETL.SRC SRC)   WHERE 1=1

Exception in component tELTMSSqlOutput_1 (testELTUpdate)
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.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:254)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1608)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:578)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:508)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7240)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2869)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:243)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:218)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:461)
	at etl_talend.testeltupdate_0_1.testELTUpdate.tELTMSSqlMap_1Process(testELTUpdate.java:1074)
	at etl_talend.testeltupdate_0_1.testELTUpdate.tDBConnection_2Process(testELTUpdate.java:1430)
	at etl_talend.testeltupdate_0_1.testELTUpdate.runJobInTOS(testELTUpdate.java:6088)
	at etl_talend.testeltupdate_0_1.testELTUpdate.main(testELTUpdate.java:5591)
[FATAL]: etl_talend.testeltupdate_0_1.testELTUpdate - tELTMSSqlOutput_1 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.
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.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:254)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1608)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:578)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:508)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7240)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2869)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:243)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:218)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:461)
	at etl_talend.testeltupdate_0_1.testELTUpdate.tELTMSSqlMap_1Process(testELTUpdate.java:1074)
	at etl_talend.testeltupdate_0_1.testELTUpdate.tDBConnection_2Process(testELTUpdate.java:1430)
	at etl_talend.testeltupdate_0_1.testELTUpdate.runJobInTOS(testELTUpdate.java:6088)
	at etl_talend.testeltupdate_0_1.testELTUpdate.main(testELTUpdate.java:5591)
[statistics] disconnected

Job testELTUpdate ended at 10:40 12/12/2018. [exit code=1]&lt;/PRE&gt; 
&lt;P&gt;Which doesn't make any sense to me.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Notice the update query it's creating:&lt;/P&gt; 
&lt;PRE&gt;UPDATE ETL.TGT SET PK=(SELECT SRC.PK  FROM  ETL.SRC SRC),STD_NAME=(SELECT  SRC.STD_NAME  FROM  ETL.SRC SRC),STD_NUM=(SELECT  SRC.STD_NUM  FROM  ETL.SRC SRC)   WHERE 1=1&lt;/PRE&gt; 
&lt;P&gt;the "1=1" clause is added by me in output component, which is configured for update.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I hope I explained the problem much better. Please advise.. &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Edit: Using Talend Cloud Data Management Platform (7.0.1)&lt;/P&gt;</description>
    <pubDate>Tue, 11 Dec 2018 23:52:09 GMT</pubDate>
    <dc:creator>chamak</dc:creator>
    <dc:date>2018-12-11T23:52:09Z</dc:date>
    <item>
      <title>MS SQL Server Merge using ELT</title>
      <link>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224097#M16944</link>
      <description>&lt;P&gt;I am trying to achieve&lt;/P&gt;
&lt;P&gt;tELTMSSQLInput -&amp;gt; tELTMSSQLMap -&amp;gt; tELTMSSQLOutput&lt;/P&gt;
&lt;P&gt;and trying to use merge statement like in tELTOracleOutput&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help on that? The update statement is completely wrong in tELTMSSQLOutput.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 01:12:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224097#M16944</guid>
      <dc:creator>chamak</dc:creator>
      <dc:date>2018-12-11T01:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: MS SQL Server Merge using ELT</title>
      <link>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224098#M16945</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;What's problem are you getting? What does your where clause look like?&lt;/P&gt; 
&lt;P&gt;Could you please have a look at this related topic and let us know if it helps?&lt;/P&gt; 
&lt;P&gt;&lt;A title="https://community.talend.com/t5/Design-and-Development/tELTORACLE-UPDATE/m-p/124292" href="https://community.qlik.com/s/feed/0D53p00007vCsfyCAC" target="_self"&gt;https://community.talend.com/t5/Design-and-Development/tELTORACLE-UPDATE/m-p/124292&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 07:12:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224098#M16945</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-11T07:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: MS SQL Server Merge using ELT</title>
      <link>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224099#M16946</link>
      <description>&lt;P&gt;Hi &lt;A href="https://community.qlik.com/s/profile/00539000004XsaeAAC"&gt;@xdshi&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Sorry for my quick non-informative question. Let me fix that.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What I'm trying to achieve is a very straight forward update all of TGT table from matching SRC table, which looks something like this:&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="SS-01.jpg" style="width: 625px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1dM.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156659i51FF033E4BC319B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1dM.jpg" alt="0683p000009M1dM.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The configuration inside the tELTMSSqlMap component looks like this:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SS-02.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1dR.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142284iBDE2A648E0E855B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1dR.jpg" alt="0683p000009M1dR.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SS-03.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1dW.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144853i62445BA85BC5765D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1dW.jpg" alt="0683p000009M1dW.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;When I run the job, it's creating a query like this:&lt;/P&gt; 
&lt;PRE&gt;Starting job testELTUpdate at 10:40 12/12/2018.
Updating with : 
UPDATE ETL.TGT SET PK=(SELECT SRC.PK  FROM  ETL.SRC SRC),STD_NAME=(SELECT  SRC.STD_NAME  FROM  ETL.SRC SRC),STD_NUM=(SELECT  SRC.STD_NUM  FROM  ETL.SRC SRC)   WHERE 1=1

Exception in component tELTMSSqlOutput_1 (testELTUpdate)
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.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:254)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1608)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:578)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:508)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7240)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2869)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:243)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:218)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:461)
	at etl_talend.testeltupdate_0_1.testELTUpdate.tELTMSSqlMap_1Process(testELTUpdate.java:1074)
	at etl_talend.testeltupdate_0_1.testELTUpdate.tDBConnection_2Process(testELTUpdate.java:1430)
	at etl_talend.testeltupdate_0_1.testELTUpdate.runJobInTOS(testELTUpdate.java:6088)
	at etl_talend.testeltupdate_0_1.testELTUpdate.main(testELTUpdate.java:5591)
[FATAL]: etl_talend.testeltupdate_0_1.testELTUpdate - tELTMSSqlOutput_1 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.
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.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:254)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1608)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:578)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:508)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7240)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2869)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:243)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:218)
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:461)
	at etl_talend.testeltupdate_0_1.testELTUpdate.tELTMSSqlMap_1Process(testELTUpdate.java:1074)
	at etl_talend.testeltupdate_0_1.testELTUpdate.tDBConnection_2Process(testELTUpdate.java:1430)
	at etl_talend.testeltupdate_0_1.testELTUpdate.runJobInTOS(testELTUpdate.java:6088)
	at etl_talend.testeltupdate_0_1.testELTUpdate.main(testELTUpdate.java:5591)
[statistics] disconnected

Job testELTUpdate ended at 10:40 12/12/2018. [exit code=1]&lt;/PRE&gt; 
&lt;P&gt;Which doesn't make any sense to me.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Notice the update query it's creating:&lt;/P&gt; 
&lt;PRE&gt;UPDATE ETL.TGT SET PK=(SELECT SRC.PK  FROM  ETL.SRC SRC),STD_NAME=(SELECT  SRC.STD_NAME  FROM  ETL.SRC SRC),STD_NUM=(SELECT  SRC.STD_NUM  FROM  ETL.SRC SRC)   WHERE 1=1&lt;/PRE&gt; 
&lt;P&gt;the "1=1" clause is added by me in output component, which is configured for update.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I hope I explained the problem much better. Please advise.. &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Edit: Using Talend Cloud Data Management Platform (7.0.1)&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 23:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224099#M16946</guid>
      <dc:creator>chamak</dc:creator>
      <dc:date>2018-12-11T23:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: MS SQL Server Merge using ELT</title>
      <link>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224100#M16947</link>
      <description>Anyone please?</description>
      <pubDate>Thu, 13 Dec 2018 06:02:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224100#M16947</guid>
      <dc:creator>chamak</dc:creator>
      <dc:date>2018-12-13T06:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: MS SQL Server Merge using ELT</title>
      <link>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224101#M16948</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069SUdAAM"&gt;@chamak&lt;/A&gt;&amp;nbsp;if you found a solution feel free to share it &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 05:09:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/MS-SQL-Server-Merge-using-ELT/m-p/2224101#M16948</guid>
      <dc:creator>maayandermer</dc:creator>
      <dc:date>2020-03-13T05:09:13Z</dc:date>
    </item>
  </channel>
</rss>

