Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Re: CHECKSUM to...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 10984 of 11517
Post > Topic >>

Re: CHECKSUM to determine record changes

by Gert-Jan Strik <sorry@[EMAIL PROTECTED] > Apr 23, 2008 at 06:42 PM

David ****tas wrote:
> 
> "rcamarda" <robert.a.camarda@[EMAIL PROTECTED]
> wrote in message
>
news:2d88cd48-2853-4f01-b797-c5c166bd167d@[EMAIL PROTECTED]
> > 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 ****tas

I agree about the advice for use ROWVERSION.

However, CHECKSUM is also just a hash. Whether the chance of an
unnotices change is lower if you use HashBytes function instead of
CHECKSUM depends on your data.

Although adding a second hash value will lower the chance of a missed
change, it would be silly to do so. In the end you would need as many
hash bytes as there are bytes in the data.

-- 
Gert-Jan
 




 4 Posts in Topic:
CHECKSUM to determine record changes
rcamarda <robert.a.cam  2008-04-21 15:22:36 
Re: CHECKSUM to determine record changes
rcamarda <robert.a.cam  2008-04-21 15:33:34 
Re: CHECKSUM to determine record changes
"David Portas"   2008-04-22 07:25:56 
Re: CHECKSUM to determine record changes
Gert-Jan Strik <sorry@  2008-04-23 18:42:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 1:10:01 CST 2008.