KeyMgtGetNextValue - Surrogate Key Generation
Moderators: chulett, rschirm, roy
KeyMgtGetNextValue - Surrogate Key Generation
Hi All,
I am planning to use KeyMgtGetNextValue for generation of Surrogate Key in multiple Jobs simultaneously.
I want every Job to start the sequence number from 1 and then keep on incrementing. Can it be done using KeyMgtGetNextValue.
What is the best possible way to generate surrogate key in Server mode in multiple different Jobs simultaneously.
I am planning to use KeyMgtGetNextValue for generation of Surrogate Key in multiple Jobs simultaneously.
I want every Job to start the sequence number from 1 and then keep on incrementing. Can it be done using KeyMgtGetNextValue.
What is the best possible way to generate surrogate key in Server mode in multiple different Jobs simultaneously.
----------------
Rgds,
Anupam
----------------
The future is not something we enter. The future is something we create.
Rgds,
Anupam
----------------
The future is not something we enter. The future is something we create.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The sequences start with 1 and go on incrementing for each sequence name argument specified to this routine.
For Eg: KeyMgtGetNextValue('X') will start from 1 and so will KeyMgtGetNextValue('Y'). Then onwards each sequence shall go on incrementing by 1 for each call made to them. If you want to reset the sequence value you can use an UPDATE statement as below
UPDATE SDKSequences USING DICT VOC SET F1 = 'New Value' WHERE @ID = 'Name of the sequence';
Hope this helps.
For Eg: KeyMgtGetNextValue('X') will start from 1 and so will KeyMgtGetNextValue('Y'). Then onwards each sequence shall go on incrementing by 1 for each call made to them. If you want to reset the sequence value you can use an UPDATE statement as below
UPDATE SDKSequences USING DICT VOC SET F1 = 'New Value' WHERE @ID = 'Name of the sequence';
Hope this helps.
Then it doesn't necessarily sound like you even need a Sequence number generator. Are you saying that you need to start them at 1 each time the job is run? If that's the case you could just use @INROWNUM.anupam wrote:I want to start the Sequence Number from 1 in each case.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers