Updated on 2024-11-30 GMT+08:00

Microsoft SQL Server->MySQL

Data Type (Microsoft SQL Server)

Data Type (MySQL)

Whether to Support Mapping

TINYINT

TINYINT

Yes. RDS for MySQL uses unsigned data.

SMALLINT

SMALLINT

Yes

INT

INT

Yes

BIGINT

BIGINT

Yes

DECIMAL

DECIMAL

Yes

NUMERIC

DECIMAL

Yes

FLOAT

FLOAT

Partially supported. The precision may be lost. You are not advised to use this data type as the primary key. Otherwise, there may be data inconsistency.

REAL

DOUBLE

Yes

SMALLMONEY

DECIMAL(10,4)

Yes. The currency symbol will be lost.

MONEY

DECIMAL(19,4)

Yes. The currency symbol will be lost.

BIT

BIT

Yes

DATE

DATE

Yes. You are not advised to use this data type as the primary key. Otherwise, there may be data inconsistency.

SMALLDATETIME

DATETIME

Yes

DATETIME2

DATETIME

Yes. The precision may be lost.

DATETIME

DATETIME

Yes

DATETIMEOFFSET

TIMESTAMP

Partially supported. The time zone will be lost.

TIME

TIME

Yes

XML

LONGTEXT

Yes

CHAR

CHAR/VARCHAR

Yes. Data is converted into the corresponding type based on the defined character length. If the defined character length is less than 256, the converted data type is CHAR. If the defined character length is greater than or equal to 256, the converted data type is VARCHAR.

VARCHAR

VARCHAR/LONGTEXT

Yes. Data is converted into the corresponding type based on the defined character length. If the defined character length is a specific number, the converted data type is VARCHAR. If the defined character length is max, the converted data type is LONGTEXT.

BINARY

BINARY/BLOB

Yes. Data is converted into the corresponding type based on the defined character length. If the defined character length is less than 256, the converted data type is BINARY. If the defined character length is greater than or equal to 256, the converted data type is BLOB.

VARBINARY

VARBINARY/LONG BLOB

Yes. Data is converted into the corresponding type based on the defined character length. If the defined character length is a specific number, the converted data type is VARBINARY. If the defined character length is max, the converted data type is LONGBLOB.

IMAGE

LONGBLOB

Yes

NTEXT

LONGTEXT

Yes

TEXT

LONGTEXT

Yes

NCHAR

CHAR/VARCHAR

Yes. Data is converted into the corresponding type based on the defined character length. If the defined character length is less than 256, the converted data type is CHAR. If the defined character length is greater than or equal to 256, the converted data type is VARCHAR.

NVARCHAR

VARCHAR/ LONGTEXT

Yes. Data is converted into the corresponding type based on the defined character length. If the defined character length is a specific number, the converted data type is VARCHAR. If the defined character length is max, the converted data type is LONGTEXT.

UNIQUEIDENTIFIER

CHAR(36)

Yes

TIMESTAMP

BINARY(8)

Yes

  • After datetimeoffset of Microsoft SQL Server is converted to timestamp of MySQL, the time zone is lost.

    The value of datetimeoffset of Microsoft SQL Server ranges from 0001-01-01 00:00:00.0000000 to 9999-12-31 23:59:59.9999999 (UTC time). The value of timestamp of MySQL ranges from 1970-01-01 00:00:01.000000 to 2038-01-19 03:14:07.999999. The date type range of Microsoft SQL Server is larger than that of MySQL. If a value is out of the range, DRS reports an error by default.

  • After datetime2 of Microsoft SQL Server is converted to datetime of MySQL, the maximum value decreases.

    The maximum value of Microsoft SQL Server is 9999-12-31 23:59:59.999999, and that of MySQL is 9999-12-31 23:59:59.499999. DRS processes the maximum value as 9999-12-31 23:59:59.