|
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
[Back to original message]
|