<?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: Loading logfiles into a SQL Server DB via XML in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341023#M109004</link>
    <description>&lt;P&gt;Hi Shong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the info.&amp;nbsp;I have tried using the tWriteXMLField and one positive thing from that is that I was able to eliminate the XML header - the XML header initially caused me issues since Talend usually encodes via UTF-8 but MS SQL Server doesn't accept that XML encoding by default (there is an "Additional Parameter" value I found that allowed the procedure to accept UTF-8 encoding).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, whether I specify the input XML parameter as a string (and convert it to XML via convert(xml, @logXML)) or if I simply declare the input parameter as XML (ALTER procedure [myproc] @logXML as varchar(max)) the stored procedure is not loading the data into the database when called from Talend.&amp;nbsp;I can take the string generated by tWriteXMLField and execute the stored procedure in SSMS (not via Talend) and the XML gets successfully processed into the DB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bill.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jan 2023 21:18:58 GMT</pubDate>
    <dc:creator>BillG-Quanex</dc:creator>
    <dc:date>2023-01-09T21:18:58Z</dc:date>
    <item>
      <title>Loading logfiles into a SQL Server DB via XML</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341021#M109002</link>
      <description>&lt;P&gt;I have a lot of logfiles that I want to load into a SQL Server database via a Talend job so that I can preserve the logs without keeping the files in the file system (we generate over 3k log files every day). I do not want to change the jobs to write to the database directly as I don't want the jobs to be dependent on the DB server being available.&lt;/P&gt;&lt;P&gt;I have created a Talend job that can read a log file and convert it to an XML document which I can then send to a SQL Server (2016) stored procedure. The stored procedure is executed, however the contents of the log file are NOT being stored in the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have ruled out the following possible causes:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;connectivity/permissions - I have logged in to SSMS with the account used by the Talend job and executed the procedure (minus the XML header since I have not found a way to have SSMS allow UTF-8)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The stored procedure is:&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;ALTER&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;procedure&lt;/P&gt;&lt;P&gt; [myschema].[myProc]&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;  &lt;/P&gt;&lt;P&gt;@logXML&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; xml,&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;  &lt;/P&gt;&lt;P&gt;@logFile&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;varchar&lt;/P&gt;&lt;P&gt;(max),&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;  &lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/90070"&gt;@result&lt;/a&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;varchar&lt;/P&gt;&lt;P&gt;(max) &lt;/P&gt;&lt;P&gt;OUT&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;begin&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;declare&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;@myAction&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;varchar&lt;/P&gt;&lt;P&gt;(max);&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;  &lt;/P&gt;&lt;P&gt;begin&lt;/P&gt;&lt;P&gt; try&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;    &lt;/P&gt;&lt;P&gt;begin&lt;/P&gt;&lt;P&gt; transaction&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;      &lt;/P&gt;&lt;P&gt;set&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;@myAction&lt;/P&gt;&lt;P&gt; = &lt;/P&gt;&lt;P&gt;'inserting log file '&lt;/P&gt;&lt;P&gt; + &lt;/P&gt;&lt;P&gt;@logFile&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;      &lt;/P&gt;&lt;P&gt;insert&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;into&lt;/P&gt;&lt;P&gt; [myDB].[mySchema].[myTable]&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;      (&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;        JobName,&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;        LogName,&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;        RunDate,&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;        LogLineNum,&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;        LogLine&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;      )&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;      (&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt; logs.value(&lt;/P&gt;&lt;P&gt;'JobName[1]'&lt;/P&gt;&lt;P&gt;, &lt;/P&gt;&lt;P&gt;'varchar(500)'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; JobName,&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;              logs.value(&lt;/P&gt;&lt;P&gt;'LogName[1]'&lt;/P&gt;&lt;P&gt;, &lt;/P&gt;&lt;P&gt;'varchar(500)'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; LogName,&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;          logs.value(&lt;/P&gt;&lt;P&gt;'runDate[1]'&lt;/P&gt;&lt;P&gt;, &lt;/P&gt;&lt;P&gt;'varchar(20)'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; runDate,&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;          lines.value(&lt;/P&gt;&lt;P&gt;'Number[1]'&lt;/P&gt;&lt;P&gt;, &lt;/P&gt;&lt;P&gt;'integer'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; LogLineNum,&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;          lines.value(&lt;/P&gt;&lt;P&gt;'Content[1]'&lt;/P&gt;&lt;P&gt;, &lt;/P&gt;&lt;P&gt;'varchar(max)'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; LogLine&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;         &lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;@logXML&lt;/P&gt;&lt;P&gt;.nodes(&lt;/P&gt;&lt;P&gt;'/LogFileContents'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; l1(logs),&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;              &lt;/P&gt;&lt;P&gt;@logXML&lt;/P&gt;&lt;P&gt;.nodes(&lt;/P&gt;&lt;P&gt;'/LogFileContents/LogLines/Line'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; l2(lines)&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;      );&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;    &lt;/P&gt;&lt;P&gt;commit&lt;/P&gt;&lt;P&gt; transaction;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;    &lt;/P&gt;&lt;P&gt;set&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/90070"&gt;@result&lt;/a&gt;&lt;/P&gt;&lt;P&gt; = &lt;/P&gt;&lt;P&gt;'SUCCESS'&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;  &lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt; try&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;  &lt;/P&gt;&lt;P&gt;begin&lt;/P&gt;&lt;P&gt; catch&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;  if @&lt;/P&gt;&lt;P&gt;@TRANCOUNT&lt;/P&gt;&lt;P&gt; &amp;gt; &lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;begin&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;rollback&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;set&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/90070"&gt;@result&lt;/a&gt;&lt;/P&gt;&lt;P&gt; = &lt;/P&gt;&lt;P&gt;'Error '&lt;/P&gt;&lt;P&gt; + &lt;/P&gt;&lt;P&gt;@myAction&lt;/P&gt;&lt;P&gt; + &lt;/P&gt;&lt;P&gt;'.  Error code: '&lt;/P&gt;&lt;P&gt; + @&lt;/P&gt;&lt;P&gt;@ERROR&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;    &lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt; catch&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The XML document generated by the Talend job looks like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt; // I do &lt;/P&gt;&lt;P&gt;not&lt;/P&gt;&lt;P&gt; have control &lt;/P&gt;&lt;P&gt;of&lt;/P&gt;&lt;P&gt; this - I &lt;/P&gt;&lt;P&gt;get&lt;/P&gt;&lt;P&gt; this "free" &lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt; Talend&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;LogFileContents&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;JobName&amp;gt;myTask&amp;lt;/JobName&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;LogName&amp;gt;myLogFile&amp;lt;/LogName&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;runDate&amp;gt;YYYYMMDDHHmiss&amp;lt;/runDate&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;LogLines&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Number&amp;gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;&amp;lt;/Number&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Content&amp;gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;st Log Message&amp;lt;/Content&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;/Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Number&amp;gt;&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&amp;lt;/Number&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Content&amp;gt;&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;nd Log Message&amp;lt;/Content&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;/Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    ...&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Number&amp;gt;&lt;/P&gt;&lt;P&gt;Last&lt;/P&gt;&lt;P&gt;&amp;lt;/Number&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Content&amp;gt;&lt;/P&gt;&lt;P&gt;Last&lt;/P&gt;&lt;P&gt; Log Message&amp;lt;/Content&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;/Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;/LogLines&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;/LogFileContents&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Talend I have tried passing the XML document to the tDBSP as a document (which results in a Talend Error). It is currently configured to pass the XML document as a String - I had to add the "sendStringParametersAsUnicode=false" to my connection string (additional parameters) to eliminate the "unable to switch encoding" error. When I check the result from the call to the stored proc I get "SUCCESS". I have even tried having the stored proc pass back a non-sense value for the result instead of "SUCCESS" (and the call to the stored proc returned the non-sense value).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the stored proc I have tried changing the input parameter to a varchar(max) and then converting that to an XML variable via&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;@logXML&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;varchar&lt;/P&gt;&lt;P&gt;(max),&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;...&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;declare&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;@myXML&lt;/P&gt;&lt;P&gt; xml = &lt;/P&gt;&lt;P&gt;convert&lt;/P&gt;&lt;P&gt;(xml, &lt;/P&gt;&lt;P&gt;@logXML&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;...&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;  &lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;@myXML&lt;/P&gt;&lt;P&gt;.nodes(...) &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; l1(logs)&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;       &lt;/P&gt;&lt;P&gt;@myXML&lt;/P&gt;&lt;P&gt;.nodes(...) &lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt; l2(lines)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which also did not load the document into the database.&lt;/P&gt;&lt;P&gt;However if I execute the stored procedure via SSMS using the XML Document (only difference is the missing &amp;lt;?xml...&amp;gt; document header):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;LogFileContents&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;JobName&amp;gt;myTask&amp;lt;/JobName&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;LogName&amp;gt;myLogFile&amp;lt;/LogName&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;runDate&amp;gt;YYYYMMDDHHmiss&amp;lt;/runDate&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;LogLines&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Number&amp;gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;&amp;lt;/Number&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Content&amp;gt;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;st Log Message&amp;lt;/Content&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;/Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Number&amp;gt;&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&amp;lt;/Number&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Content&amp;gt;&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;nd Log Message&amp;lt;/Content&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;/Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    ...&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Number&amp;gt;&lt;/P&gt;&lt;P&gt;Last&lt;/P&gt;&lt;P&gt;&amp;lt;/Number&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;      &amp;lt;Content&amp;gt;&lt;/P&gt;&lt;P&gt;Last&lt;/P&gt;&lt;P&gt; Log Message&amp;lt;/Content&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;    &amp;lt;/Line&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;  &amp;lt;/LogLines&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;/LogFileContents&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The entire contents loads as expected (The log file I am testing with has 40 lines and all 40 show up in the database, exactly as I expect).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also reviewed the following links - but they are in regards to processing XML files, not XML strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://stackoverflow.com/questions/69092809/parsing-xml-data-into-sql-server" target="_blank"&gt;Parsing XML Data Into SQL Server&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://stackoverflow.com/questions/26463153/importing-xml-file-into-sql-server-2000-using-openrowset" target="_blank"&gt;Importing XML file into SQL Server 2000 using OPENROWSET&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel like there's something not quite configured right in Talend but I'm not sure where that would be. Any input/guidance would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341021#M109002</guid>
      <dc:creator>BillG-Quanex</dc:creator>
      <dc:date>2024-11-15T22:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Loading logfiles into a SQL Server DB via XML</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341022#M109003</link>
      <description>&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;I'm not a SQL SERVER stored procedure expert, can you try to pass XML content as a string type? In the job, you can use a tWriteXMLField to write a XML string. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 08:33:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341022#M109003</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-09T08:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Loading logfiles into a SQL Server DB via XML</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341023#M109004</link>
      <description>&lt;P&gt;Hi Shong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the info.&amp;nbsp;I have tried using the tWriteXMLField and one positive thing from that is that I was able to eliminate the XML header - the XML header initially caused me issues since Talend usually encodes via UTF-8 but MS SQL Server doesn't accept that XML encoding by default (there is an "Additional Parameter" value I found that allowed the procedure to accept UTF-8 encoding).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, whether I specify the input XML parameter as a string (and convert it to XML via convert(xml, @logXML)) or if I simply declare the input parameter as XML (ALTER procedure [myproc] @logXML as varchar(max)) the stored procedure is not loading the data into the database when called from Talend.&amp;nbsp;I can take the string generated by tWriteXMLField and execute the stored procedure in SSMS (not via Talend) and the XML gets successfully processed into the DB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bill.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 21:18:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341023#M109004</guid>
      <dc:creator>BillG-Quanex</dc:creator>
      <dc:date>2023-01-09T21:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Loading logfiles into a SQL Server DB via XML</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341024#M109005</link>
      <description>&lt;P&gt;So it seems that I need to add a tDBCommit after calling the stored procedure - even though the stored procedure has transaction handling inside.  It appears to have something to do with the fact that I'm using a tDBConnection for my tDBSP instead of configuring the connection in the tDBSP component.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 20:16:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341024#M109005</guid>
      <dc:creator>BillG-Quanex</dc:creator>
      <dc:date>2023-01-19T20:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Loading logfiles into a SQL Server DB via XML</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341025#M109006</link>
      <description>&lt;P&gt;Does it work now if you use a tDBCommit? If you use the DB connection created by tDBConnection, you should use a tDBCommit to commit the changes.​&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 03:16:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341025#M109006</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-20T03:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Loading logfiles into a SQL Server DB via XML</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341026#M109007</link>
      <description>&lt;P&gt;Shong - yes it works now.  I'm curious as to why I need a tDBCommit when the stored procedure had a commit in it.  The point of having the stored procedure was, in part, to have it handle the transaction rather than having to manage the transaction (and rollback) in Talend.  Is this a function of (1) SQL server,  (2) Java (seems unlikely as I have worked with Java developers elsewhere who used Oracle PL/SQL stored procedures that handled the transactions) or a (3) design choice by Talend?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 18:46:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Loading-logfiles-into-a-SQL-Server-DB-via-XML/m-p/2341026#M109007</guid>
      <dc:creator>BillG-Quanex</dc:creator>
      <dc:date>2023-01-24T18:46:31Z</dc:date>
    </item>
  </channel>
</rss>

