...
> hi,
> is it safe to assume that BINARY_CHECKSUM will return the same result ONLY
> if the parameters passed to it are the same?
> i.e. if i have a table Contact with the following columns ( Firstname
> varchar(50), lastname varchar(50), email varchar(80) )
> Should i assume that BINARY_CHECKSUM( Firstname, lastname, email) returns
> different values as long as the data in those three columns are different
> and that it would return the same value ONLY is the data in the fields is
> EXACTLY the same?
On 6 Jun, 17:40, "Joey" <j
@mail.com> wrote:
> hi,
> is it safe to assume that BINARY_CHECKSUM will return the same result ONLY
> if the parameters passed to it are the same?
> i.e. if i have a table Contact with the following columns ( Firstname
> varchar(50), lastname varchar(50), email varchar(80) )
> Should i assume that BINARY_CHECKSUM( Firstname, lastname, email) returns
> different values as long as the data in those three columns are different
> and that it would return the same value ONLY is the data in the fields is
> EXACTLY the same?
No. CHECKSUM returns an INT, for which there are only about 4 billion
possible values. You don't have to generate many checksums before you
hit a duplicate. Do the math.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--