I found a strange thing today. I picked up a Dataflow that was duplicating surrogate keys. When I looked, the developer had done a ‘manual’ SCD Type 2 / History Preservation but without using the built in transforms.
On New inserts, the used the Key_Generation transform.
On Update inserts, he has the key_generation() function on the same table.
It seems that when there are both inserts and updates to process, these 2 calls generate the same numbers. When I saw this my first thought was that this would happen, but it does beg the question; when there are many Key Generations for the same table in the same Dataflow, do they generate unique keys? Also the same question applies to larger scopes; same workflow, same job, many jobs.
Having explored this further, it seems there is absolutely no co-ordination between any number of key generation transforms/functions, wherever they appear.
So, I guess my next visit is to the ‘requested enhancements’ section…