Comparison of Real Data type

rcroederrcroeder Posts: 9
For sometime now I have and annoying issues comparison of Real data type, when that data is value is 0. RedGate does create a update, however when I rerun the comparison it shows that the fields do not match. Any ideas? This has been around for a long time.

UPDATE [dbo].[tbl_Site] SET [floatLatitude]=0, [floatLongitude]=0 WHERE [siteID]=10027155

[floatLatitude] [real] NULL,
[floatLongitude] [real] NULL,
rc roeder

Comments

  • Hi there,

    Thanks for your post. Unless I am mistaken, it sounds to me as if you are using SQL Data Compare to compare tables where you have a Float as the data type, is that correct?

    If so, SQL Data Compare doesn't really handle floats very well due to the nature of what they are, therefore the advised workaround is to create a view which extracts data from the float column but rounds it and displays the value as an integer.

    You can then map the source table including the Float against the target view which has been set up as an Int and perform a comparison which if you then update the view will update the underlying float column too.

    Please let me know though if I have misunderstood your issue!

    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.