1

File 1 Intput :

<?xml version="1.0" encoding="utf-8"?>
<saw:ibot xmlns:saw="com.siebel.analytics.web/report/v1.1" version="1" priority="normal" xmlns:cond="com.oracle.bi/conditions/v1" xmlns:sawx="com.siebel.analytics.web/expression/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" jobID="79" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><saw:schedule timeZoneId="(GMT-08:00) Pacific Time (US &amp; Canada); Tijuana"><saw:start startImmediately="false" date="2017-07-06" time="11:30:00"/><saw:recurrence runOnce="false"><saw:weekly weekInterval="2" thu="true"/></saw:recurrence></saw:schedule><saw:dataVisibility type="runAsUser" runAs="weblogic" runAsGuid="weblogic"/><cond:condition/><saw:choose><saw:when condition="true"><saw:deliveryContent disposition="attachment" format="excel2007"><saw:headline><saw:caption><saw:text>DO &amp; RVP</saw:text></saw:caption></saw:headline><saw:reportRef path="/shared/BJs Analytics/Agent/Reports/Dana DO &amp; RVP"/><saw:attachmentMessage><saw:caption><saw:text>DO &amp; RVP Report</saw:text></saw:caption></saw:attachmentMessage></saw:deliveryContent><saw:postActions/></saw:when><saw:otherwise><saw:postActions/></saw:otherwise></saw:choose><saw:deliveryDestinations><saw:destination category="pcemail"/></saw:deliveryDestinations><saw:recipients specificRecipients="true" subscribers="false" customize="false"><saw:specificRecipients><saw:user name="dtaylor" guid="dtaylor"/><saw:user name="eluster" guid="eluster"/></saw:specificRecipients><saw:subscribers/></saw:recipients><saw:emailRecipients/></saw:ibot>

File 2 Input:

<?xml version="1.0" encoding="utf-8"?>
<saw:ibot xmlns:saw="com.siebel.analytics.web/report/v1.1" xmlns:cond="com.oracle.bi/conditions/v1" xmlns:sawx="com.siebel.analytics.web/expression/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1" priority="normal" jobID="145" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><saw:schedule timeZoneId="(GMT-08:00) Pacific Time (US &amp; Canada); Tijuana"><saw:start startImmediately="false" date="2017-07-06" time="11:30:00"/><saw:recurrence runOnce="false"><saw:weekly weekInterval="2" thu="true"/></saw:recurrence></saw:schedule><saw:dataVisibility type="runAsUser" runAs="weblogic" runAsGuid="weblogic"/><cond:condition/><saw:choose><saw:when condition="true"><saw:deliveryContent disposition="attachment" format="excel2007"><saw:headline><saw:caption><saw:text>Test Mail from bjri-obi-004</saw:text></saw:caption></saw:headline><saw:reportRef path="/shared/BJs Analytics/Agent/Reports/Dana DO &amp; RVP"/><saw:attachmentMessage><saw:caption><saw:text>DO &amp; RVP Report</saw:text></saw:caption></saw:attachmentMessage></saw:deliveryContent><saw:postActions/></saw:when><saw:otherwise><saw:postActions/></saw:otherwise></saw:choose><saw:deliveryDestinations><saw:destination category="pcemail"/></saw:deliveryDestinations><saw:recipients specificRecipients="true" subscribers="false" customize="false"><saw:specificRecipients><saw:user name="ereeh" guid="ereeh"/></saw:specificRecipients><saw:subscribers/></saw:recipients><saw:emailRecipients/></saw:ibot>

Required Output:

Is it possible to merge FILE 1 and FILE 2 XML via SQL query.
Amit Karwa
  • 13
  • 3
  • Please go through below link: https://stackoverflow.com/questions/9228208/merging-xml-in-an-sql-server – JERRY Sep 14 '18 at 06:45
  • 3
    Are you really talking about *files*? There are XML files somewhere in your system and te goal is to achieve one big file? SQL-Server does not seem to be the right tool for this. If you need to use SQL-Server read about `BCP` to read a file into SQL-Server and to write the result back to a file. But I'd tend to *Powershell*... – Shnugo Sep 14 '18 at 07:12

1 Answers1

1

Why would you want to use SQL server for this? Just use an XQuery engine like Saxon or BaseX that is able to access a folder as a collection, and use the query

<merged>{collection('/my/folder/')}</merged>
Michael Kay
  • 156,231
  • 11
  • 92
  • 164