Hi
my source data is like for example
KeyColNm Surrogatekey
------------
A .............10
A .............20
A .............30
A .............40
B .............10
B .............20
B .............30
C .............10
C .............20
C .............30
C .............40
C ............. 50
Means, like my requirement is when data value changes in key column, then the surrogate value should start from initial values and should increment 10 when the value is repeating.
Any suggestions please
Thanks
Surrogate key generator
Moderators: chulett, rschirm, roy
sarogate Key
Yes that is Right, and if you want to generate with a increment of 1 then use the following as a stage varible in transformar "0 + @INROWNUM +(mod(@PARTITIONNUM,@NUMPARTITIONS)) + ((@INROWNUM-1) * (@NUMPARTITIONS-1))"
Ulab----------------------------------------------------
help, it helps you today or Tomorrow
help, it helps you today or Tomorrow
-
- Premium Member
- Posts: 457
- Joined: Tue Sep 25, 2007 4:05 pm
Re: sarogate Key
This derivation of yours works with only round-robin partitioning, correct?ulab wrote:Yes that is Right, and if you want to generate with a increment of 1 then use the following as a stage varible in transformar "0 + @INROWNUM +(mod(@PARTITIONNUM,@NUMPARTITIONS)) + ((@INROWNUM-1) * (@NUMPARTITIONS-1))"
Vivek Gadwal
Experience is what you get when you didn't get what you wanted
Experience is what you get when you didn't get what you wanted
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 3
- Joined: Wed Jun 11, 2008 8:08 am