How to comare datetime and float columns

intruderintruder Posts: 3
Hello,
I must compare tables from different databases, but I must exclude the difference in time part of datetime columns. Also I want to ignore the difference in columns with float data type, where the values are almost the same (for sample the difference of values is less then 0.000001).

Can I achieve this with SQL Data Compare 8?

Thanks in advance.

Regards,
Dimitar

Comments

  • Hi Dimitar,

    Would ignoring the timestamp column in this instance work for you? If so, this is in the options of SQL Data Compare.

    On the float issue, the only thing you can do is from the tables & views tab, click on columns in comparison and deselect those with the datatype of float.

    Pete
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
  • Hi Peter,

    Thanks for replay, but ignoring columns will not solve the problem, because I expect differences in that columns, and I must analyze these differences.


    Regards,
    Dimitar
  • Hi Dimitar,

    When you say ignoring won't work, do you mean on the timestamp colums or the float values?

    In theory, another option available to you would be to create a view in each database that trims, casts or rounds the float. I guess you could also round the datetime to the nearest day / hour as well, which may help if you didn't want to ignore timstamp columns. You more than likely though wouldn't be able to update the target though.

    If you went with the view approach, you would also need to ensure that comparing views is turned on in the options of SQL Data Compare.

    Pete
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
Sign In or Register to comment.