Sunday, March 25, 2012

BINARY_CHECKSUM

Hi All,
I am using BINARY_CHECKSUM value to detect the changes i.e. while
comparing two table's data. I have tested with few data. Seems it is
working fine. Are there any limitations to use BINARY_CHECKSUM
function? I know it will not with few data types. Luckily I don't
have those data types n both the tables.
So Pls inform me the Limitation and the steps i need to consider while
using BINARY_CHECKSUM function?
Or pls suggest me some other easiest method.
Thanks and regards
PraveenPraveen
Yes , there is a chance that you will get the same values for different
data
Please search on internet , I think it was a discussion about that some
times ago at this forum
"Praveen" <apveen@.gmail.com> wrote in message
news:1147676068.594978.14940@.u72g2000cwu.googlegroups.com...
> Hi All,
> I am using BINARY_CHECKSUM value to detect the changes i.e. while
> comparing two table's data. I have tested with few data. Seems it is
> working fine. Are there any limitations to use BINARY_CHECKSUM
> function? I know it will not with few data types. Luckily I don't
> have those data types n both the tables.
> So Pls inform me the Limitation and the steps i need to consider while
> using BINARY_CHECKSUM function?
> Or pls suggest me some other easiest method.
>
> Thanks and regards
> Praveen
>|||Any type of checksum or hash may not properly detect changes in a huge
number of cases -- BINARY_CHECKSUM's output is only 4 bytes, whereas if you
have many columns there could be hundreds or thousands of bytes of input
data. I do not recommend relying on checksums for this purpose. Instead,
compare either column by column, or maintain either a ROWVERSION or a date
last updated column.
For more information on why checksums are a poor choice, see:
http://en.wikipedia.org/wiki/Pigeonhole_principle
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Praveen" <apveen@.gmail.com> wrote in message
news:1147676068.594978.14940@.u72g2000cwu.googlegroups.com...
> Hi All,
> I am using BINARY_CHECKSUM value to detect the changes i.e. while
> comparing two table's data. I have tested with few data. Seems it is
> working fine. Are there any limitations to use BINARY_CHECKSUM
> function? I know it will not with few data types. Luckily I don't
> have those data types n both the tables.
> So Pls inform me the Limitation and the steps i need to consider while
> using BINARY_CHECKSUM function?
> Or pls suggest me some other easiest method.
>
> Thanks and regards
> Praveen
>sql

No comments:

Post a Comment