Page 1 of 1

Sequences

Posted: Tue Jan 23, 2007 1:59 pm
by tmcnicol
I am familiar with the sequence function in the server environment, is this done using the surrogate key generator stage, and if so, is the last number used saved somewhere or does is have to be derived at the beginning of job where the sequence is needed?

Re: Sequences

Posted: Tue Jan 23, 2007 2:08 pm
by zam62
tmcnicol wrote:I am familiar with the sequence function in the server environment, is this done using the surrogate key generator stage, and if so, is the last number used saved somewhere or does is have to be derived at the beginning of job where the sequence is needed?
The Surrogate Key generator has a 'start value' property under the keys. What you would need to do is get the desired starting value and pass it in as a job parameter, or have a lookup stage to get that value and add it to the Surrogate Key generated in a TX stage following the SK stage.
IE...
do A lookup to get the max val from the table you wish to load and store that in a field being passed to the KEY_GEN stage. Then in the following TX stage, add that value to the generated value from the KEY_GEN stage and store that in the column that you want to be the key.

Posted: Tue Jan 23, 2007 2:12 pm
by DSguru2B
Welcome Aboard 8)
It has to be derived and fed to the surrogate key generator as a parameter. Click herefor a recent discussion on this topic.