I have a problem using the SSIS. I try to import data from database one to database two. Therefore I use a OLE DB Source with the following command:
SELECT Name, Description, JobID
FROM DBone.Table
My problem is, that I only want to import new data from this source. So I use a second OLE DB Source withe the following command:
SELECT JobID
FROM DBtwo.Table
Now I want to import only the data from database one, where the JobID is not in database two. So my idea was to use a Merge Join for the two data sources, so that my data looks like this.
Name | Description | DBone.JobID | DBtwo.JobID
-----------------------------------------------
'One'| 'Little test.' | 4 | 4
'Two'| 'Little test.' | 6 | NULL
So I have the possibility to identify new data, because the column DBtwo.JobID is NULL.
Now my question: How do I say SSIS to import only the data into database two where the DBtwo.JobID is NULL or to delete this data before import?
I think I can answer my question by myself, because I find a way to filter the data.
After I merged the two tables using the Merge Join Component I added a Script Component. In this component I set the ExclusionGroup for the output from 0 to 1 and added the follwing code to the script:
So the Script Component filters the data.