You are here: Re: BINARY_CHECKSUM algorithm « MsSQL Server « IT news, forums, messages
Re: BINARY_CHECKSUM algorithm

Posted by Erland Sommarskog on 06/25/05 13:25

Orly Junior (nomail@nomail.com) writes:
> Do you know if the algorithm for the BINARY_CHECKSUM function in
> documented somewhere? I would like to use it to avoid returning some
> string fields from the server. By returning only the checksum I could
> lookup the string in a hashtable and I think this could make the code
> more efficient on slow connections.

Risky business. The checksum algorithm is fairly simple-minded. I beleive
it uses some xor mechanism. I don't have the references around right now,
but I recall that SQL Server MVP Steve Kass demonstrated how some quite
small changes could result in the same checksum.

Better in such case, to augment the table with a timestamp column. Such
a column is automatically updated every time SQL Server updates the
row. So you could store the timestamp client side, and pass that value,
if the table has the same value, there is no need for a refresh.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация