Perform the following
steps to configure the SCD Type 2 Loader:
-
Open the properties
window of the SCD Type 2 Loader and select the Change
Tracking tab. Note that datetime change tracking is enabled
by default and datetime values are delivered to the columns VALID_FROM_DTTM
and VALID_TO_DTTM.
-
Select Use
current indicator, and then click the down arrow in Current
indicator column. Select the CURRENT_ROW column.
Note: The Use current
indicator check box must be selected to avoid redundant
updates to the End Date column if the Use beginning and
end dates check box is selected in the Change
Tracking tab and Close out records not in
the source table is set to Yes in
the Options tab.
-
Open the
Business
Key tab and specify the source columns that comprise the
business key. During change detection, the business key columns are compared between each incoming
source row and the entire target. If the business keys match between the source and
target, then data values are compared
to detect changes. Frequently, the business key is the primary key in the source.
For the purposes of this example, click
New and select
Customer_ID.
-
Open the Detect
Changes tab and specify the columns that are tracked for Type 2 updates. The number and length
of these columns affects the run-time performance of the job. In the sample job, select
Street_ID and Customer_Type_ID,
and then click the right arrow.
Note: As a best practice, set
both the Use current indicator option and
the Use beginning and end dates option in
the Change Tracking tab for the SCD Type
2 Loader when one or more columns have been selected in the Detect
Changes tab for Type 2 updates.
-
Open the Type
1 Columns tab and specify the columns that are updated
in the most current rows of their respective business keys, without
affecting the begin and end datetime values. Select Customer_Lastname and Customer_Address,
and then click the right arrow.
-
Open the Generated
Key tab and specify the numeric column that receive the generated key value. Click the
down arrow in the Column field
and specify CUSTOMER_DIM_ID. When the job runs, unique identifiers are added to this column for each row in the
table.
-
Click OK to
save changes and close the properties window.