Foolish me. Twice this week I've been burned by SQL Server 2000 BINARY_CHECKSUM.
For those of you who haven't used this, SQL Server BOL states "BINARY_CHECKSUM can be used to detect changes to a row of a table."
First burn: I was trying generate a unique value based on a 20 column reporting key (for ad hoc aggregates). Out of 50,000 rows, it assigned a hand full the same value (even though the 20 keys were different!).
Second burn: instead of using a multiple column LEFT JOIN to evaluate if a composite key existed in the source table, I did a BINARY_CHECKSUM value subquery. For example:
SELECT col01, col02, col03
FROM TableA
WHERE BINARY_CHECKSUM(col01, col02, col03) NOT IN
(SELECT BINARY_CHECKSUM(col01, col02, col03) FROM TableX)
Well I found out that rows were NOT getting inserted because of a match on BINARY_CHECKSUM to a value that was the same - but with underlying columns that were definitely not the same.
The lesson? Use BINARY_CHECKSUM to detect just row changes, but not as a key-lookup function.
Also, I don't see a reference to this function in SQL Server 2005 June CTP BOL yet? Have they removed it? Hmmmmm.