Monday, January 4, 2016

How to use Diff and Patch in XML Task in SSIS 2014

Diff: This option uses difference algorithms to compare two XML documents to produce a third document called an XML Diffgram that contains the differences between them. Use this option with another XML Task using the Patch option to produce a smaller subset of data to insert into your data store. An example use of this task is extracting only the prices that have changed from a new price sheet in XML format.

Patch: This option applies the results of a Diff operation to an XML document to create a new XML document.


The following example show that how to use Diff operation type.
Create a two XML file with some data difference something like shown below.
Set the configuration as shown below and run the job
You will get two output files, one for the operation result is TRUE or FALSE and other one data difference.
Diff.xml
DiffData.xml
Patch


This option applies the results of a Diff operation to an XML document to create a new XML document.
In this example let’s see how to patch the above Diff example output.
Set the configuration and run.
You will notice that the output file will contains the difference as well.
Cheers!
Uma

2 comments: