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

151 Views Asked by At

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? Is it a bug of SSMA? If so, is there any workaround to make the two values the same? 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
)

1

There are 1 best solutions below

3
On

More a display than storage thing.

drop table if exists t,TEST;
create table t
(
id int auto_increment
primary key,
value float(20,1) null,
val2  float null
);

# insert data.
insert into t(value,VAL2) values(90177104,90177104);

SELECT T.* ,CAST(`VALUE` AS DECIMAL),CAST(`VAL2` AS DECIMAL) FROM T;

# id, value, val2, CAST(`VALUE` AS DECIMAL), CAST(`VAL2` AS DECIMAL)
'1', '90177104.0', '90177100', '90177104', '90177104'