April 21, 2004 at 11:07 am
Is there any way I can calculate a checksum digit using 'Sum of Product - Mod 10' method without looping through each digit?
What I mean by 'Sum of Product - Mod 10' is:
- Multiply each digit with 1 or 2 and sum the result of all such calculations on each digit
- Check sum digit is = 10 - (Sum % 10)
Example string : 02530010828400000008607
Thanks.
April 21, 2004 at 11:50 pm
did you look at BOL for CHECKSUM ?
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
April 22, 2004 at 9:12 am
CHECKSUM routine is used to get a unique (in almost all cases but no guarantees) numeric value for a column value so that this unique value can be used to create performance enhancing indices. I can't find the underlying implementation of the routine but it does not return a check digit.
I have created a stored proc that returns my check digit value on any string using the Mod-10 Sum of Product method. It serves my purpose. I was looking for something similar to CHECKSUM that I can apply to the string directly rather than looping through each digit in the string. Anyway, thanks.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy