To generate surrogate keys, add a Surrogate Key Generator
stage to a job with a single output link to another stage.
About this task
If you want to pass input columns to the next stage in
the job, the Surrogate Key Generator stage can also have an input
link.
Procedure
- Open the Surrogate Key Generator stage editor.
- On the Stage page, define the stage properties:
- Click the Properties tab.
- Type a name for the surrogate key column in the Generated
Output Column Name property.
- Type or browse for the source name.
- Select the source type.
- If the source type is a database sequence, define the
Database Type properties.
- If the key source is a flat file, specify how keys are
generated:
- To generate keys in sequence from the highest value that was last
used, set the Generate Key from Last Highest Value property
to Yes. Any gaps in the key range are ignored.
- To specify a value to initialize the key source, add the File
Initial Value property to the Options group, and specify
the start value for key generation.
- To control the block size for key ranges, add the File
Block Size property to the Options group, set this property
to User specified, and specify a value for the block
size.
- If there is no input link, add the Number
of Records property to the Options group, and specify how
many records to generate.
- Optional: On the Advanced tab, change the
processing settings for the stage.
- Optional: If the stage has an input link, on
the Input page, define the input data:
- On the Partitioning tab, change the partition settings
for the input link.
- On the Advanced tab, change the buffer settings for
the input link.
- On the Output page, define the output data:
- On the Mapping tab, map the surrogate key column to
the output link. If the stage has an input link, you can
also map input columns to the output link.
- Optional: On the Advanced tab, change the
buffer settings for the output link.
- Click OK to save your changes and
to close the Surrogate Key Generator stage editor.