View Single Post

   
  #3 (permalink)  
Old 04-24-2008, 07:07 PM
David Portas
 
Posts: n/a
Default Re: CHECKSUM to determine record changes

"rcamarda" <robert.a.camarda@gmail.com> wrote in message
news:2d88cd48-2853-4f01-b797-c5c166bd167d@k13g2000hse.googlegroups.com...
> Im using SQL Server 2005 currently patched.


CHECKSUM isn't a reliable way to detect change because it's quite common to
find different rows with the same CHECKSUM value. You could use a ROWVERSION
column instead. ROWVERSION is guaranteed to increment when the row data is
updated.

Another alternative is to use a hash. The HashBytes function will return a
secure hash of a binary value with a very high probability of uniqueness.
Duplicate hashes are theoretically possible but are incredibly unlikely to
occur unintentionally. If you are extremely paranoid then you can use two
different hashes.

--
David Portas


Reply With Quote