TheBugSlayer
Programmer
Hello all.
I am trying to understand why CHECKSUM is yielding
1)a different result for the same input values based on whether they are coming from a view or from a table
2)the same value for different input values from the same function.
Is the source of the input values factor into the CHECKSUM formula (view, table, etc)?
Does CHECKSUM makes some assumptions depending on whether one input parameter is empty(I convert to '' when NULL)?
My input, whether from the view, which feeds the table eventually, or from the table are:
Last Name, First Name, Number
COOK, BRENT,
BRAY, DAVID,
KHAN, AMY,
KHAN, ALI,
The CHECKSUM(LastName, FirstName, Number) function returns
2047633
2047633
9523382
9523382
respectively when calculated from the view that populates the table.
Why do COOK-BRAY and KHAN-KHAN have the same hash (2047633 and 9523382)?
The same function applied to the table populated from the view returns
2021169596
-394774451
1148953778
75211809
which is more correct in my opinion as all the values are different...I don't understand.
Your help is appreciated.
MCP SQL Server 2000, MCTS SQL Server 2005, MCTS SQL Server 2008 (DBD, DBA), Training HOTT cert SQL Server 2012 Business Intelligence (SSIS, SSAS).
I am trying to understand why CHECKSUM is yielding
1)a different result for the same input values based on whether they are coming from a view or from a table
2)the same value for different input values from the same function.
Is the source of the input values factor into the CHECKSUM formula (view, table, etc)?
Does CHECKSUM makes some assumptions depending on whether one input parameter is empty(I convert to '' when NULL)?
My input, whether from the view, which feeds the table eventually, or from the table are:
Last Name, First Name, Number
COOK, BRENT,
BRAY, DAVID,
KHAN, AMY,
KHAN, ALI,
The CHECKSUM(LastName, FirstName, Number) function returns
2047633
2047633
9523382
9523382
respectively when calculated from the view that populates the table.
Why do COOK-BRAY and KHAN-KHAN have the same hash (2047633 and 9523382)?
The same function applied to the table populated from the view returns
2021169596
-394774451
1148953778
75211809
which is more correct in my opinion as all the values are different...I don't understand.
Your help is appreciated.
MCP SQL Server 2000, MCTS SQL Server 2005, MCTS SQL Server 2008 (DBD, DBA), Training HOTT cert SQL Server 2012 Business Intelligence (SSIS, SSAS).