In this post, We will see how to generate surrogate key for data, where we have to use surrogate key stage.
A) Design :
Below design is a demo design of job. Here our data source is a row generator which is generating rows. In real time scenario, Source can be a flat file, DB stages, Passive Stage or can be a Active stage also.
In Row Generator Stage, we are generating a col "Name".
B) Surrogate Key Stage Properties :
In Surrogate Stage, fill all the properties of Surrogate Key Stage like below...
Generated Output Column Name = Skey
Source Name = <the path of Surrogate State File (which we generated) >
Source Type = Flat File
File Block Size = User specified
User Specified Block Size = 1 ( by this we can control the gaps in surrogate keys )
C) Output Column Mapping :
Map the column to output.
D) OutPut File :
Below I have attached output file which have surrogate keys generated with data.
More post in Series :
I hope, Now you got how to generate the Surrogate Keys for the data without having headache of management of keys. But there is still a scenario what if our state file got corrupted or deleted ? We will discuss this in next post.....Keep Reading.....
Like the Facebook Page & join Group