Binary checksum does not consider more than 255 characters in Microsoft SQL Server

     Binary checksum in Microsoft SQL Server is a good function to compare strings in data base without affecting performance of queries. The function Binary_CheckSum() will genreate a checksum for the string entered in the specified column and it will be easier and faster to compare that integer value rather than comparing the strings. The benefit of using Binary_CheckSum() instead of checksum() is that it is case sensitive as it uses the ASCII value of each character and  calculates the Binary_CheckSum().

     But think twice before using these functions for large strings. These functions will consider only 255 characters. If the character length exceeds 255 characters, the check sum will reset and start again and consider characters greater than 256 only. So, for example, the computed Binary checksum of the single character 'a' will be same as that of a 257 character string whose last character is 'a'.

Comments

Popular posts from this blog

Hide notification content in Android lock screen for Messages, email, whatsapp and selected apps.

Array functions in JavaScript