hashbytes
/*
Checksum() isnt very good for detecting data changes. Use hashbytes() instead
Example of output from script below:
-361975519341300.801789
*/
Checksum() isnt very good for detecting data changes. Use hashbytes() instead
Example of output from script below:
-361975519341300.801789
*/
select avg(cast(cast(hsh as bigint) as decimal(25,0))) as truncatedHash
from (
select cast(HASHBYTES('SHA1',
[StringField1]+
[StringField2]+
[StringField3]) as binary(20)) as hsh
FROM dbo.TableToBeInvestigated
) as hashedData
Comments