Generate sequence number using parallel job
Posted: Sun Jun 18, 2017 11:19 am
I want to generate sequence numbers starting from 1 every time the job run.
Number should be generated in sequence without gaps in 4 node job.
Thing i have already tried
1) (@inrownum - 1) * @numpartitions + @partitionnum + 1
The above formula only works in 2 node.
2) Column generator - It creates gaps between numbers in 4 nodes and the numbers are not in sequence.
3) Surrogate Key - It takes the last highest value and starts from there. I want it to start from 1 for each job run. Is there any way to reset the key ?
Any suggestions is welcome.
Thanks in Advance.
Number should be generated in sequence without gaps in 4 node job.
Thing i have already tried
1) (@inrownum - 1) * @numpartitions + @partitionnum + 1
The above formula only works in 2 node.
2) Column generator - It creates gaps between numbers in 4 nodes and the numbers are not in sequence.
3) Surrogate Key - It takes the last highest value and starts from there. I want it to start from 1 for each job run. Is there any way to reset the key ?
Any suggestions is welcome.
Thanks in Advance.