Results 1 to 8 of 8
  1. #1
    Join Date
    May 2005
    Posts
    30

    Unanswered: binary_checksum craziness

    Folks, hi.
    Any idea why this patently different items return the same binary_checksum value:

    select
    binary_checksum('X', convert(datetime,'2006-13-12'), convert(datetime,'2007-17-04'), convert(datetime, null),'X','X','X','X','X','S','X') [1],

    binary_checksum('X', convert(datetime, '2006-28-11'), convert(datetime,'2007-17-04'), convert(datetime, null),'X','X','X','X','X','B','X') [2]

    The core of a very major system is based on these computing unique values for a unique set of expressions!

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Because BINARY_CHECKSUM is not guaranteed to be unique. From BOL:
    BINARY_CHECKSUM(*), computed on any row of a table, returns the same value as long the row is not subsequently modified. BINARY_CHECKSUM(*) will return a different value for most, but not all, changes to the row, and can be used to detect most row modifications.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by jhml
    The core of a very major system is based on these computing unique values for a unique set of expressions!
    Oops. Somebody should have done some research first, eh?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by blindman
    Oops. Somebody should have done some research first, eh?
    At the risk of overstepping my bounds: don't be an anacedent.

    Regards,

    hmscott
    Have you hugged your backup today?

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Point taken....
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    May 2005
    Posts
    30
    A most helpful forum indeed it has to be said.

  7. #7
    Join Date
    Apr 2007
    Posts
    183
    Here is how CHECKSUM is calculated. You can see for yourself how Microsoft do and why many checksums are the same.

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=70832

  8. #8
    Join Date
    May 2005
    Posts
    30
    Thanks Peso.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •