are using checksum for hashing numbers with sticks will make issue ?

ahmed salah 3,216 Reputation points
2022-05-23T09:38:14.023+00:00

i work on sql server 2017 i need to use check sum for hashing but im afraid if i got stuck or issue when compare

my data all will be numbers only or numbers with stick

example of my data

121
121|145
155|233|2231

so are check sum hashing with these number will make issue for me

when comparing for that numbers from database ?

Developer technologies Transact-SQL
SQL Server Other
{count} votes

3 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2022-05-23T10:35:00.81+00:00

    so are checksum are gurantee

    the function CHECKSUM returns an integer value, so max 4 G different values, so as I wrote it's not a unique value, different values can return the same checkum.
    See
    https://learn.microsoft.com/en-us/sql/t-sql/functions/checksum-transact-sql?view=sql-server-ver15

    1 person found this answer helpful.

  2. Tom Phillips 17,771 Reputation points
    2022-05-23T16:51:47.827+00:00

    "155|233|2231" is not "numbers with sticks", it is a string. SQL Server, and checksum, has no knowledge there are numbers separated by |.

    1 person found this answer helpful.
    0 comments No comments

  3. Olaf Helper 47,436 Reputation points
    2022-05-23T10:07:54.407+00:00

    Not clear what your issue is, may can you explain it more detailed, pülease?
    A hash value is nothing unique, if it's that what you mean.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.