Doubt about Surrogate Key Generation
Posted: Tue Feb 19, 2008 4:02 pm
I have a table called "Test".
Data in the Table is :
Test
--------------------------------
Col 1 | Col 2 | Col 3
-------------------------------
123 | abc | test0
223 | dcf | test2
123 | abc | test3
I want to generate the surrogate key based on the values in Col 1 and Col 2.
When i am generating the key using the surrogate stage and defining Col1 and Col 2 as key in Metadata, i am getting the result as :
TestTarget
--------------------------------
Col | Col 1 | Col 2 | Col 3
-------------------------------
1 |123 | abc | test0
2 |223 | dcf | test2
3 |123 | abc | test3
I was thinking that i will get 2 rows in output and the Datastage will drop a row as the record seems to be duplicate based on the keys
If the above result is correct then this can be achieved using a Column Generator and increment the value by one.
Just wondering what difference it make having a surrogate key.
Thanks
Manish
Data in the Table is :
Test
--------------------------------
Col 1 | Col 2 | Col 3
-------------------------------
123 | abc | test0
223 | dcf | test2
123 | abc | test3
I want to generate the surrogate key based on the values in Col 1 and Col 2.
When i am generating the key using the surrogate stage and defining Col1 and Col 2 as key in Metadata, i am getting the result as :
TestTarget
--------------------------------
Col | Col 1 | Col 2 | Col 3
-------------------------------
1 |123 | abc | test0
2 |223 | dcf | test2
3 |123 | abc | test3
I was thinking that i will get 2 rows in output and the Datastage will drop a row as the record seems to be duplicate based on the keys
If the above result is correct then this can be achieved using a Column Generator and increment the value by one.
Just wondering what difference it make having a surrogate key.
Thanks
Manish