if its in unicode so the results : ( notice the N )
select CHECKSUM(N'2Volvo Director 20') ---341465450
select CHECKSUM(N'3Volvo Director 30') ---341453853
select CHECKSUM(N'4Volvo Director 40') ---341455363
but if its regular :
select CHECKSUM('2Volvo Director 20') ---1757834048
select CHECKSUM('3Volvo Director 30') ---1757834048
select CHECKSUM('4Volvo Director 40') ---1757834048
Can you please explain me why in the first situation – it gives me different and in the second it gives me the same ?
there is a lead article about it which says :
However the CHECKSUM() function evaluates the type as well as compares the two strings and if they are equal, then only the same value is returned.
This seems to be collation dependant.
Returns
CHECKSUMis documented as being more collision prone thanHashBytes. I’m not sure specifically why theCPcollation has this behaviour for these inputs though.