<?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 [resolved] tMSSqlOutputBulkExec conversion error for int, always in line 517641 in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331973#M100899</link>
    <description>Hello, 
&lt;BR /&gt;I've been trying to make a bulk insertion in a SQL Server table, but failing because no matter what I do, the result is always the same:&amp;nbsp;java.sql.SQLException: Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 17641, column 13 
&lt;BR /&gt;The original field is a nullable int (in MySQL) and I'm inserting a nullable int (in SQL Server). The biggest value it has is 1428. 
&lt;BR /&gt;Until now I've tried the following: 
&lt;BR /&gt; 
&lt;BR /&gt;Change the Code page ("OEM", "RAW", "ACP"), the Data File Type ("char", "native") and the Encoding ("UTF-8", "unicode", "ISO-8859-15")&amp;nbsp;of the&amp;nbsp;tMSSqlOutputBulkExec component 
&lt;BR /&gt;Inserting the same int fot all the registers. Tried 1 and new Integer("1") 
&lt;BR /&gt;Splitting the total of insertions in parts of 500.000 registers. The total is almost 8 million, so I thought MAYBE it was a matter of memory, but it failed again in the second batch in the line 17641. Only this time, to effectively split the table I order it before splitting it, so the register in that line was different, and the value in the problematic column was different. The strange this is that a lot of registers before said line have the same value in that specific column, but the error always presents ifself in THAT line. 
&lt;BR /&gt; 
&lt;BR /&gt;The 517641 line in the&amp;nbsp;mssql_data.txt file looks like this: 
&lt;BR /&gt;;2;89909;509410018692;15;04-05-2011;4;;4;;4;; 
&lt;U&gt;655&lt;/U&gt;;703;4 
&lt;BR /&gt;And with the third attempt in the list, the 17641 line in the mssql_data.txt looks like this: 
&lt;BR /&gt;;2;89510;515118016329;15;04-05-2011;89;;89;;89;; 
&lt;U&gt;684&lt;/U&gt;;660;89 
&lt;BR /&gt;Additionally, when I restrict the insertion only to the registers with the problem, so the bulk insert is reduced to about 50 lines, it inserts without any problem at all. And I have executed a very similar job in the past, with successful results, from the very same origin table but with a different table as destination for the data. 
&lt;BR /&gt;Nothing seems to work, and I've started to have nightmares with that 517641 number. Am I doing something wrong? Has anyone encounter a problem like this before? What's with that line number? 
&lt;BR /&gt;Thanks in advance for any help or guidance you can provide.</description>
    <pubDate>Tue, 07 Oct 2014 17:02:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-10-07T17:02:09Z</dc:date>
    <item>
      <title>[resolved] tMSSqlOutputBulkExec conversion error for int, always in line 517641</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331973#M100899</link>
      <description>Hello, 
&lt;BR /&gt;I've been trying to make a bulk insertion in a SQL Server table, but failing because no matter what I do, the result is always the same:&amp;nbsp;java.sql.SQLException: Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 17641, column 13 
&lt;BR /&gt;The original field is a nullable int (in MySQL) and I'm inserting a nullable int (in SQL Server). The biggest value it has is 1428. 
&lt;BR /&gt;Until now I've tried the following: 
&lt;BR /&gt; 
&lt;BR /&gt;Change the Code page ("OEM", "RAW", "ACP"), the Data File Type ("char", "native") and the Encoding ("UTF-8", "unicode", "ISO-8859-15")&amp;nbsp;of the&amp;nbsp;tMSSqlOutputBulkExec component 
&lt;BR /&gt;Inserting the same int fot all the registers. Tried 1 and new Integer("1") 
&lt;BR /&gt;Splitting the total of insertions in parts of 500.000 registers. The total is almost 8 million, so I thought MAYBE it was a matter of memory, but it failed again in the second batch in the line 17641. Only this time, to effectively split the table I order it before splitting it, so the register in that line was different, and the value in the problematic column was different. The strange this is that a lot of registers before said line have the same value in that specific column, but the error always presents ifself in THAT line. 
&lt;BR /&gt; 
&lt;BR /&gt;The 517641 line in the&amp;nbsp;mssql_data.txt file looks like this: 
&lt;BR /&gt;;2;89909;509410018692;15;04-05-2011;4;;4;;4;; 
&lt;U&gt;655&lt;/U&gt;;703;4 
&lt;BR /&gt;And with the third attempt in the list, the 17641 line in the mssql_data.txt looks like this: 
&lt;BR /&gt;;2;89510;515118016329;15;04-05-2011;89;;89;;89;; 
&lt;U&gt;684&lt;/U&gt;;660;89 
&lt;BR /&gt;Additionally, when I restrict the insertion only to the registers with the problem, so the bulk insert is reduced to about 50 lines, it inserts without any problem at all. And I have executed a very similar job in the past, with successful results, from the very same origin table but with a different table as destination for the data. 
&lt;BR /&gt;Nothing seems to work, and I've started to have nightmares with that 517641 number. Am I doing something wrong? Has anyone encounter a problem like this before? What's with that line number? 
&lt;BR /&gt;Thanks in advance for any help or guidance you can provide.</description>
      <pubDate>Tue, 07 Oct 2014 17:02:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331973#M100899</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-07T17:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tMSSqlOutputBulkExec conversion error for int, always in line 517641</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331974#M100900</link>
      <description>hi,&lt;BR /&gt;perhaps try first to use the bulk load from SQL command ; could be something like this &lt;BR /&gt;&lt;PRE&gt;BULK&lt;BR /&gt;INSERT db.yourtable&lt;BR /&gt;FROM 'C:/yourFiletoInsert.txt'&lt;BR /&gt;WITH&lt;BR /&gt;(&lt;BR /&gt;FIELDTERMINATOR = '|',&lt;BR /&gt;ROWTERMINATOR = '\n'&lt;BR /&gt;)&lt;BR /&gt;GO&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;And see if you got same errors.&lt;BR /&gt;regards&lt;BR /&gt;laurent</description>
      <pubDate>Wed, 08 Oct 2014 13:12:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331974#M100900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-08T13:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tMSSqlOutputBulkExec conversion error for int, always in line 517641</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331975#M100901</link>
      <description>Thank you Laurent for your answer. 
&lt;BR /&gt;Since my post I have been searching for non printable characters in the file (because I read in some forums that BOM, for example, can cause the kind of error I'm facing) without any luck. 
&lt;BR /&gt;I tried what you suggested, using this script: 
&lt;BR /&gt; 
&lt;PRE&gt;BULK&lt;BR /&gt;INSERT DB.MyTable&lt;BR /&gt;FROM 'C:\Users\Public\Documents\mssql_data.txt'&lt;BR /&gt;WITH&lt;BR /&gt;(&lt;BR /&gt;FIELDTERMINATOR = ';',&lt;BR /&gt;ROWTERMINATOR = '\n'&lt;BR /&gt;)&lt;BR /&gt;GO&lt;/PRE&gt; 
&lt;BR /&gt;The firs time I tried with just '\n' as row terminator, because that's what I had configured in the&amp;nbsp;tMSSqlOutputBulkExec component in my job, but I got: 
&lt;BR /&gt; 
&lt;PRE&gt;Msg 4866, Level 16, State 1, Line 2&lt;BR /&gt;The bulk load failed. The column is too long in the data file for row 1, column 15. Verify that the field terminator and row terminator are specified correctly.&lt;BR /&gt;Msg 7399, Level 16, State 1, Line 2&lt;BR /&gt;The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.&lt;BR /&gt;Msg 7330, Level 16, State 2, Line 2&lt;BR /&gt;Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;So I changed it for '\r\n', but got the same result. 
&lt;BR /&gt;The last column is a not nullable int, so it madeno sense to say it's TOO LONG, because the firs line of the file looked like this: 
&lt;BR /&gt; 
&lt;PRE&gt;;2;698471;113186005032;1;01-10-2011;33;;33;;33;;116;1271;33&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;Then I changed it for '-FINALFINAL-', and again tried the manual bulk insert and got this:&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;Msg 4864, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 517641, column 13 (field).&lt;BR /&gt;Msg 4864, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 689068, column 13 (field).&lt;BR /&gt;Msg 4864, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 715321, column 12 (field).&lt;BR /&gt;Msg 4864, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 715322, column 12 (field).&lt;BR /&gt;Msg 4864, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 715323, column 12 (field).&lt;BR /&gt;Msg 4864, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 715331, column 12 (field).&lt;BR /&gt;Msg 4863, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (truncation) for row 721779, column 12 (anotherField).&lt;BR /&gt;Msg 4864, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 724515, column 12 (anotherField).&lt;BR /&gt;Msg 4863, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (truncation) for row 727204, column 12 (anotherField).&lt;BR /&gt;Msg 4863, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (truncation) for row 784293, column 12 (anotherField).&lt;BR /&gt;Msg 4864, Level 16, State 1, Line 1&lt;BR /&gt;Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 784444, column 12 (anotherField).&lt;BR /&gt;Msg 4865, Level 16, State 1, Line 1&lt;BR /&gt;Cannot bulk load because the maximum number of errors (10) was exceeded.&lt;BR /&gt;Msg 7399, Level 16, State 1, Line 1&lt;BR /&gt;The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.&lt;BR /&gt;Msg 7330, Level 16, State 2, Line 1&lt;BR /&gt;Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;When Talend generates the file and tries to bulk insert it I keep getting the same error in the same line, and the error seems to be the same when I try to do the insertion manually. I don't know if it affects that I'm using SQL Server 2012.</description>
      <pubDate>Wed, 08 Oct 2014 16:51:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331975#M100901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-08T16:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tMSSqlOutputBulkExec conversion error for int, always in line 517641</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331976#M100902</link>
      <description>it seems that you have problem of structure and data type ..
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;type mismatch or invalid character&lt;BR /&gt;truncation&lt;BR /&gt;&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Profile your data sources to find none-compliant lines.
&lt;BR /&gt;you have to correct data &amp;amp; structures if necessary.</description>
      <pubDate>Thu, 09 Oct 2014 09:32:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331976#M100902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-09T09:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tMSSqlOutputBulkExec conversion error for int, always in line 517641</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331977#M100903</link>
      <description>Thank you for your answer. 
&lt;BR /&gt;Never mind the truncation, is just an observations field that is too long, and that I can easily resolve. 
&lt;BR /&gt;The type mismatch or invalid character was the real problem, because, as I mentioned before, it was just an int, and in the 517641 line there were no strange characters that made the bulk insert attempts fail. BUT, I went again to the file to check this new ordered 571641 line, and found that in the previous column there's a ";" within the text. ";" was my field terminator. 
&lt;BR /&gt;So I change it to "]" and it worked! Silly me, with this mistake taking hours of my time, but I still think is super strange that I wasn't able to see the line with the actual problem, until I include an ordering in the query that brings the data from the source table. 
&lt;BR /&gt;Marking this as solved, thank you very much for your attention, Laurent.</description>
      <pubDate>Mon, 13 Oct 2014 14:29:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331977#M100903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-13T14:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tMSSqlOutputBulkExec conversion error for int, always in line 517641</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331978#M100904</link>
      <description>glad that you have solved your problem.&lt;BR /&gt;for 57164 and previous line, perhaps it's because , the count start from zero ...&lt;BR /&gt;regards&lt;BR /&gt;laurent</description>
      <pubDate>Tue, 14 Oct 2014 10:00:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331978#M100904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-14T10:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tMSSqlOutputBulkExec conversion error for int, always in line 517641</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331979#M100905</link>
      <description>No... I checked the lines around that infamous 517641, but nothing seemed out of place.
&lt;BR /&gt;
&lt;FONT size="2"&gt;Perhaps t&lt;/FONT&gt;he bulk insertion orders before it inserts?</description>
      <pubDate>Tue, 14 Oct 2014 20:19:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tMSSqlOutputBulkExec-conversion-error-for-int-always-in/m-p/2331979#M100905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-14T20:19:02Z</dc:date>
    </item>
  </channel>
</rss>

