SSMA for MySQL - values of float data type are different between MySQL and SQL Server

Lei Xiao 31 Reputation points
2022-04-15T06:54:29.113+00:00

I am using SSMA for MySQL tool to migrate data from MySQL to SQL Server 2016. After migration data completed. The field value of float type from MySQL table is different from SQL Server field. In MySQL table, the value is 90177104, but in SQL Server table, the value is 90177100. Can anyone please explain why the values are different? Thanks!

MySQL table schema:

create table test
(
id int auto_increment
primary key,
value float null
);

insert data.

insert into test(value) values(90177104);

SQL Server table schema:

create table test
(
id int identity
constraint table_name_pk
primary key nonclustered,
value float default NULL
)

SQL Server Migration Assistant
SQL Server Migration Assistant
A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.
568 questions
{count} vote

2 answers

Sort by: Most helpful
  1. PrasannaSridharan-MSFT 96 Reputation points Microsoft Employee
    2022-04-16T03:46:03.367+00:00

    Hey LeiXiao - could you please confirm that you are able to see the exact values using say MySQL client e.g. Workbench? My tests show me following:

    insert into test(value) values(90177104);
    insert into test(value) values(9017714);
    insert into test(value) values(90177104.4);

    select * from test

    RESULT-->

    id,value
    1,90177100
    2,9017710
    3,90177100


  2. YufeiShao-msft 7,146 Reputation points
    2022-04-18T06:25:51.723+00:00

    Hi @Lei Xiao ,

    float and real (Transact-SQL)

    For 1-24 value, the precision is 7 digits

    for example:

    CREATE TABLE DemoTable    
    (   
      MyFloat FLOAT(24),  
    );  
      
    INSERT INTO DemoTable VALUES (90177104);    
    

    the output value is
    193785-1.png
    this is just 90177100

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.