BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JJP1
Pyrite | Level 9

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

@JJP1 

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? 

View solution in original post

3 REPLIES 3
Patrick
Opal | Level 21

@JJP1 

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? 

JJP1
Pyrite | Level 9

Yes Thanks @Patrick .

 

SAS Innovate 2025: Register Now

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!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 3 replies
  • 1336 views
  • 0 likes
  • 3 in conversation