Adding Original Surrogate Key Functionality

Topics: Questions About the Code or Project
May 20, 2011 at 9:04 PM
Edited May 20, 2011 at 9:19 PM

First of all, I would like to thank you for all your hard work on this project.  This is a key component that definately needed a rewrite.  I would like to start using the KSCD in my packages from here on out, but I need to make a small modification so that the component will conform to my company's best practice methodologies.  Specifically, I am trying to add an original surrogate key column type.  An o-key is simply a field that points back to the value of the first surrogate key for the given business key.  So as new SCD2 records are inserted, we can easliy group all the historical records together. 

I've just about got the feature added, but I'm running into a little trouble trying to determine where it is that I can query for the value of the original surrogate key.  I believe that I can set the value of the original surrogate key column in the "Direct Row To SCD2 New" region of the ProcessCache_SendUpdatedExistingToSCD2New() function, but where would I be able to query the existing dimension source to determine what that value should be? It would appear that I can use the RuntimeInputCache to determine whether we can get this value or not, but I'm not sure how that class is used exactly.  Any hints you could give would be greatly appreciated.

It also might be a moot point since we can only set this field if the existing dimension cache is complete.  Otherwise, I would have to set this field after the record hits the output path and before it gets loaded into the target table.

- Brett