https://github.com/UltraSQL/sqlserver-kit/blob/master/SQL%20Server%20Data%20Types.md
SQL Server to MySQL, Oracle, PostgreSQL, SQLite Data Type Mapping
General Type | Type | MySQL | Oracle | PostgreSQL | SQLite |
---|---|---|---|---|---|
Exact Numerics | bit | TINYINT(1) | NUMBER(3) | BOOLEAN | INTEGER |
Exact Numerics | tinyint | TINYINT(signed) | NUMBER(3) | SMALLINT | INTEGER |
Exact Numerics | smallint | SMALLINT | NUMBER(5) | SMALLINT | INTEGER |
Exact Numerics | int | MEDIUMINT, INT | NUMBER(10) | INT | INTEGER |
Exact Numerics | bigint | BIGINT | NUMBER(19) | BIGINT | INTEGER |
Exact Numerics | decimal | DECIMAL | NUMBER(p[,s]) | DECIMAL(p,s) | REAL |
Exact Numerics | smallmoney | DOUBLE | NUMBER(10,4) | MONEY | REAL |
Exact Numerics | money | DOUBLE | NUMBER(19,4) | MONEY | REAL |
Approximate Numerics | float | FLOAT DOUBLE; REAL |
FLOAT(49) | DOUBLE PRECISION | REAL |
Date and Time | date | DATE | DATE | TEXT | |
Date and Time | smalldatetime | TIMESTAMP | DATE | TIMESTAMP(0) | TEXT |
Date and Time | time | TIME | TIME | TEXT | |
Date and Time | datetime2 | DDATETIME | TIMESTAMP | TEXT | |
Date and Time | datetime | DATE | TIMESTAMP(3) | TEXT | |
Date and time | datetimeoffset | TIMESTAMP with time zone |
TEXT | ||
Caracter Strings | char | CHAR | CHAR | CHAR | TEXT |
Caracter Strings | varchar | VARCHAR | VARCHAR2 | VARCHAR | TEXT |
Caracter Strings | varchar | VARCHAR2 | TEXT | TEXT | |
Caracter Strings | nchar | NCHAR | NCHAR | TEXT | |
Caracter Strings | nvarchar | NCHAR | VARCHAR | TEXT | |
Caracter Strings | nvarchar | VARCHAR TINYTEXT TEXT(M) MEDIUMTEXT LONGTEXT |
NCHAR | TEXT | TEXT |
Caracter Strings | ntext | LONG | TEXT | TEXT | |
Caracter Strings | text | LONG | TEXT | TEXT | |
Binary Strings | image | LONGBLOB | LONG RAW | BYTEA | BLOB |
Binary Strings | binary | BINARY | RAW | BYTEA | BLOB |
Binary Strings | varbinary | RAW | BYTEA | BLOB | |
Binary Strings | varbinary | VARBINARY(M) TINYBLOB BLOB MEDIUMBLOB LONGBLOB |
RAW | BYTEA | BLOB |
Other Data Types | cursor | TEXT | |||
Other Data Types | sql_variant | BLOB | TEXT | ||
Other Data Types | hierarchyid | TEXT | |||
Other Data Types | rowversion | BYTEA | TEXT | ||
Other Data Types | timestamp | RAW | BYTEA | TEXT | |
Other Data Types | uniqueidentifier | CHAR | CHAR(36) | CHAR(16) | TEXT |
Other Data Types | xml | XML | TEXT | ||
Other Data Types | table | - | |||
Spatial Data Types | geometry | VARCHAR | TEXT | ||
Spatial Data Types | geography | VARCHAR | TEXT |
(* These data types will be removed in a future version of SQL Server. Avoid using these data types in new projects, and try to change them in current projects)