Re: binary_checksum and validated software environments > I would guess that the chances of (a) someone making a change
> to a script and (b) that change delivering functionality that can be
> compiled and be meaningful, is fairly, if not very remote, as to be
> irrelevant.
You would be wrong. It's trivially easy to find checksum collisions.
SELECT BINARY_CHECKSUM('ABA'), BINARY_CHECKSUM('ACQ')
Result:
----------- -----------
17761 17761
(1 row(s) affected)
As a further test I ran the following query on the syscomments table of
a database containing about 200 procs, views, etc. and got 3 rows
returned:
SELECT DISTINCT OBJECT_NAME(T1.id), BINARY_CHECKSUM(T1.text)
FROM syscomments AS T1
JOIN syscomments AS T2
ON BINARY_CHECKSUM(T1.text) = BINARY_CHECKSUM(T2.text)
AND T1.text <> T2.text
This result is perfectly natural and expected when you consider that
there are "only" 2^32 possible checksums - many orders of magnitude
fewer than the number of syntactically valid and useful pieces of
script.
--
David Portas
SQL Server MVP
-- |