I'm working on the production of a Data Warehouse
with SSIS
, and today we create the first dimension with SCD of type 2. The fact table is linked in the DIM_CIPESSOA
dimension through the idcipessoa
column.
When updating the dimension, as shown below, a new PK is generated and with this we need to update the FK in the fact table to connect the lines correctly.
Dimension Table:
idcipessoa cgccpf_AltKey tppessoa nomepessoa effectiveDate expiryDate IsCurrent
----------- -------------- -------- ----------------- ------------------------ ------------------------ ---------
88393 00000000001 1 CUSTUMER OLD 2018-04-02 11:52:47.040 2018-04-02 22:29:05.243 0
169852 00000000001 1 CUSTOMER UPDATED 2018-04-02 22:55:08.540 9999-12-31 23:59:59.997 1
Fact Table
idFact idcipessoa tppessoa
------- ----------- --------
1 88393 1.99
So, as in the example above, we need a strategy to align the fact table to be pointed to the new new key 169852
.