Run query to compare Data in XML file to SQL Server Table
I have an SSIS project that uploads an XML file into a SQL Server table. I would like to run a query against the XML file that tests whether any of the primary keys in the XML file already exist in the SQL table. How can this be done?
October 27th, 2010 1:08pm
you can use XML Source to read the xml data, then you can use Lookup transformation to find match rows based on primary keys,http://www.rad.pasfu.com
October 27th, 2010 2:29pm
Thanks Reza. Using the lookup worked. For those interested I set the lookup error output to redirect (to prevent the step from failing) and sent all matching rows to a Row Count transformation. The row count populates a variable. I then set the parent Data Flow task precedence to an expression that reads the variable, and based on the result, either stops or continues the job.
October 27th, 2010 4:20pm