Implement slowly changing dimension with SSIS

To implement Slowly Chaning Dimensions using the SSIS SCD components, followe these steps.

1. In your Control Tab, add a Data Flow task
2. Edit the Data Flow task and add an OLE DB Source
3. Double-click the OLE DB Source and connect to your source table, either in the OLTP
    environment, or a staging table within the DW
4. Add a Slowly Changing Transform and connect it to the precedence constraint from the
    OLDE DB Source









5. Next, Double-click the Slowly Changing Dimension transform to start the Slowly Changing Dimension Wizard, and click Next
6. On the Select A Dimension Table And Keys window, select Connection Manager to              connect to the destination DW
7. Select Table Or View for the destination table
8. Map the Input Columns to the Dimension Columns
9. Make sure that only one column is marked as “Business Key”, which is the key from the
    source table
10. Ensure all of the other Key Type columns are marked as “Not A Key Column” as shown       in. Click Next.















11. Next, select the change type option for each of the Slowly Changing Dimension           Columns as shown and then click Next. The options available include:
Dimension Columns Pick the columns to be used for SCD
Change Type Select what SCD Type you want each column to be
Historical attribute (Type 2) Keeps all old values—no overwriting
Changing attribute (Type 1) Keeps only current value--overwrites old value
Fixed Attribute (Type 0) Value cannot be changed















Select the Fixed and Changing Attribute option as shown. The options include:
Fixed Attributes If you have fixed attributes in your SCD transform, you can check  this option (fail the transformation if changes are detected in a fixed attribute) so that any change to a fixed attribute fails the transform with an error. But if this is unchecked, it simply ignores the change and does not bring it into the DW and doesn’t give an error.

Changing Attributes If you check this option (change of all the matching records, including outdated records, when changes are detected in a changing attribute), the new value being updated for a column also updates earlier historical values. This basically overwrites the current value into all of the earlier historical values for that column.
















12. Next, select the Historical Attribute Options as shown. As mentioned earlier, both options require having either one or two additional columns available for historical tracking of changes for each record.
Use A Single Column To Show Current And Expired Records This option only uses a single string column and marking it as either:
   Current / Expired
   True / False
Use Start And End Dates To Identify Current And Expired Records This option uses two columns to mark the beginning and ending dates of the record’s life:
   Start date column
   End date column
Variable To Set Date Values Here you can select where the date values for above Start and End dates are gotten from. These can be gotten from the user variable defined by you or these system variables:
   CreationDate DateTime the package was created
   ContainerStartTime Start DateTime of the container
   StartTime The DateTime the package started to run


















13. Next, select the Inferred Dimension Members option. This allows for handling of an inferred member when you have late arriving dimension table records (or early arriving fact tables).
The output of the Slowly Changing Wizard is the fully designed SCD tasks as shown:
Historical Attribute Inserts (Output) Manages inserting new rows and expiring old rows
New (Output) Manages inserting new rows
Changing Attributes Updates (Output) Manages updating rows without any history















Comments

Popular Posts

Non-blocking, semi-blocking, and blocking transforms in SSIS

Implement additive, semi-additive, and non-additive measures

Design an appropriate storage solution, including hardware, disk, and file layout