Checksum_agg not working as expected.

  • Why would checksum_agg return the same value, though the column lists are different.  The Binary_checksum values are different, I checked.  (I can't check the whole table, just a subset of columns.)  thanks.

     

    1>

    2> select checksum_agg(binary_checksum( Mtr_Func, Time_Zone, Rdg_Dte, Rdg_Tme, Ext_Cust_Id, Mtr_Val, Mtr_Rdg_Pulse, Mtr_

    Const, Channel, Inbound_Batch_Id))

    3> from tMtr_Rdg_Stage_BU where Inbound_Batch_Id = 564

    4> go

     -----------

       448303104

    (1 row affected)

    1>

    2>

    3> select checksum_agg(binary_checksum(Time_Zone, Rdg_Dte, Rdg_Tme, Ext_Cust_Id, Mtr_Val, Mtr_Rdg_Pulse, Mtr_Const, Chan

    nel, Inbound_Batch_Id))

    4> from tMtr_Rdg_Stage_BU where Inbound_Batch_Id = 564

    5> go

     -----------

       448303104

    (1 row affected)

    1>

     

     

     

  • I'm guessing that this is merely a function of the checksum mathematics.  It's hit or miss as to whether removing a column will cause this.  I decided it doesn't really matter (though it's good to know) as long as your comparison columns match.  I now believe that I can trust a multicolumn aggregate checksum.

     

     

  • Are you sure Mtr_Func is not one of the non-comparable data types?  I've tried it on northwind..employees and the result is different if I remove a "normal" data type, but the same if I remove a noncomparable (ie. text, ntext, image, cursor, sql_variant).


    Cheers,
    - Mark

  • Nope...just a varchar causes this.

  • That varchar column isn't all null is it?


    Cheers,
    - Mark

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply