I am using SSIS in VS 2013.
I need to get a list of IDs from 1 database, and with that list of IDs, I want to query another database, ie SELECT ... from MySecondDB WHE
This is a classic case for using LookUp Transformation
. First, use a OLE DB Source
to get data from the first database. Then, use a LookUp Transformation
to filter this data-set based on the ID
values from the second data-set. Here is the steps for using a LookUp Transformation
:
General
tab, select Full Cash
, OLE DB Connection Manager
and Redirect rows to no match output
as shown in the following picture. Notice that using Full Cash
provides great performance for your package.General Setting
Connection
tab, use OLE DB Connection Manager
to connect to your second server. Then, you can either directly select the data-set with ID
values or (as is shown in the picture below) you can use SQL code to select the IDs from the filtering data-set.Connection:
Columns
tab and select ID
columns from the both datasets. For each record from your first data-set, it will check to see if its ID
is in the Available LookUp Column
. If it is, it will go to the Matching
output, else to No Matching
output.Match ID columns:
OK
to close the LookUp
. Then you need to select the LookUp Match Output
.Match Output: