Hash Collision percentage on HASHBYTES SHA2_512

Larimore Suanque 41 Reputation points
2020-08-27T07:20:17.623+00:00

Hello, we are trying to move a large table and want to confirm the varbinary values do not change (or at least capture it if it changes). We plan to use below query:

select ID, HASHBYTES('SHA2_512', cast(blob AS VARBINARY(8000))) from BlobTable;

I understand it is possible to have the same hashvalue even for different inputs in hash collision.

Would Microsoft know what is the percentage this could happen?

Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,552 questions
0 comments No comments
{count} votes

Accepted answer
  1. MelissaMa-MSFT 24,176 Reputation points
    2020-08-27T07:52:51.537+00:00

    Hi @Larimore Suanque

    Please refer below links and check whether they are helpful to you. Thanks.

    Choosing the right algorithm in HashBytes function
    Hash Collision Probabilities

    If the response is helpful, please click "Accept Answer" and upvote it.

    Best regards
    Melissa


0 additional answers

Sort by: Most helpful