MySQL Workbench Manual  /  ...  /  Microsoft SQL Server Type Mapping

10.5.4 Microsoft SQL Server Type Mapping

The following table shows the mapping between Microsoft SQL Server (source) data types and MySQL data types.

Table 10.2 Type mapping

Source Type MySQL Type Comment
INT INT
TINYINT TINYINT UNSIGNED flag set in MySQL.
SMALLINT SMALLINT
BIGINT BIGINT
BIT TINYINT(1)
FLOAT FLOAT Precision value is used for storage size in both.
REAL FLOAT
NUMERIC DECIMAL
DECIMAL DECIMAL
MONEY DECIMAL
SMALLMONEY DECIMAL
CHAR CHAR/LONGTEXT Depending on its length. MySQL Server 5.6 and higher can have CHAR columns with a length up to 255 characters. Anything larger is migrated as LONGTEXT.
NCHAR CHAR/LONGTEXT Depending on its length. MySQL Server 5.6 and higher can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types. In MySQL, a character set of strings depends on the column character set instead of the data type.
VARCHAR VARCHAR/MEDIUMTEXT/LONGTEXT Depending on its length. MySQL Server 5.6 and higher can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types.
NVARCHAR VARCHAR/MEDIUMTEXT/LONGTEXT Depending on its length. MySQL Server 5.6 and higher can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types. In MySQL, a character set of strings depends on the column character set instead of the data type.
DATE DATE
DATETIME DATETIME
DATETIME2 DATETIME Date range in MySQL is '1000-01-01 00:00:00.000000' to '9999-12-31 23:59:59.999999'. Note: fractional second values are only stored as of MySQL Server 5.6.4 and higher.
SMALLDATETIME DATETIME
DATETIMEOFFSET DATETIME
TIME TIME
TIMESTAMP TIMESTAMP
ROWVERSION TIMESTAMP
BINARY BINARY/MEDIUMBLOB/LONGBLOB Depending on its length.
VARBINARY VARBINARY/MEDIUMBLOB/LONGBLOB Depending on its length.
TEXT VARCHAR/MEDIUMTEXT/LONGTEXT Depending on its length.
NTEXT VARCHAR/MEDIUMTEXT/LONGTEXT Depending on its length.
IMAGE TINYBLOB/MEDIUMBLOB/LONGBLOB Depending on its length.
SQL_VARIANT not migrated There is not specific support for this data type.
TABLE not migrated There is not specific support for this data type.
HIERARCHYID not migrated There is not specific support for this data type.
UNIQUEIDENTIFIER VARCHAR(64) A unique flag set in MySQL. There is not specific support for inserting unique identifier values.
SYSNAME VARCHAR(160)
XML TEXT