Hi ,
Iam trying to create a job using SCD type 2 loader to handle historic data.
So i understood from documentation that business key tab in SCD type 2 transformation is where i need to provide the column
which can be used to compare the rows between source and target to detect changes and maintain history.
Would you please suggest any LIVE scenario on Generated Key has to be defined or not really needed when i want to create the datasets that should store historical data .
please suggest when Is it really needed or not really needed when we want to create historic dataset ?
If you're loading an SCD2 table you will need a generated key. This can either be a unique key or a retained key.
A unique key is unique per row, a retained key is unique per business key (so kind-off a group key which only becomes a primary key if you also add the valid_from_dttm variable).
You want such a generated key so you don't have to replicate the full business key (which can be a composite key comprised of multiple lengthy variables) to related tables (for linking records). You rather want to just use the generated key as foreign key in related tables.
Does that make sense to you?
If you're loading an SCD2 table you will need a generated key. This can either be a unique key or a retained key.
A unique key is unique per row, a retained key is unique per business key (so kind-off a group key which only becomes a primary key if you also add the valid_from_dttm variable).
You want such a generated key so you don't have to replicate the full business key (which can be a composite key comprised of multiple lengthy variables) to related tables (for linking records). You rather want to just use the generated key as foreign key in related tables.
Does that make sense to you?
Yes Thanks @Patrick .
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.