A code has a 20 character limit but it needs to be unique. To make it unique there are 3 parts combinations of these values will exceed the 20 characters limits, more like 40 – 50 size. So the idea is to generate some type of unique ID based on that string, but does not exceed 20 characters.
I was exploring the possible use of SQL Server Hashbytes function which put everything into hash and make it smaller (examples below).
However, all of the old 16 bit/32 bit hash function has been retired by Microsoft, and the newer ones which a lot more accurate will have something around 30 – 40 characters. Which defeats the purpose.
Any ideas?
Just a thought...
On option is to convert the
hashbytes()to abigint.Example
Results