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

10.5.4 Microsoft SQL Server Type Mapping

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.5 and above 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.5 and above can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types. In MySQL, character set of strings depend on the column character set instead of the datatype.
VARCHAR VARCHAR/MEDIUMTEXT/LONGTEXT Depending on its length. MySQL Server 5.5 and above 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.5 and above can have VARCHAR columns with a length up to 65535 characters. Anything larger is migrated to one of the TEXT blob types. In MySQL, character set of strings depend on the column character set instead of the datatype.
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
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 datatype.
TABLE not migrated There is not specific support for this datatype.
HIERARCHYID not migrated There is not specific support for this datatype.
UNIQUEIDENTIFIER VARCHAR(64) A unique flag set in MySQL. There is not specific support for inserting unique identifier values.
SYSNAME VARCHAR(160)  
XML TEXT  


User Comments
Sign Up Login You must be logged in to post a comment.