{
    "name": "Cross-Database SQL Type Mapping Reference",
    "description": "Conventional data type equivalents for 13 canonical types across 15 database engines, with the conversion traps that cause silent truncation or data loss.",
    "url": "https://www.dbsofts.com/reference/type-mapping/",
    "generated": "2026-12-05T10:52:36+00:00",
    "publisher": {
        "name": "DBSofts",
        "url": "https://www.dbsofts.com/"
    },
    "note": "Conventional equivalents used when migrating between engines, not a specification. Precision, collation and empty-value handling still need to be decided per table. A null value means the engine has no dedicated type for that role.",
    "canonical_types": [
        {
            "key": "integer",
            "label": "Integer (32-bit)"
        },
        {
            "key": "bigint",
            "label": "Integer (64-bit)"
        },
        {
            "key": "decimal",
            "label": "Fixed decimal"
        },
        {
            "key": "float",
            "label": "Floating point"
        },
        {
            "key": "boolean",
            "label": "Boolean"
        },
        {
            "key": "string_short",
            "label": "Short text"
        },
        {
            "key": "string_long",
            "label": "Long text / CLOB"
        },
        {
            "key": "binary",
            "label": "Binary / BLOB"
        },
        {
            "key": "date",
            "label": "Date"
        },
        {
            "key": "time",
            "label": "Time"
        },
        {
            "key": "timestamp",
            "label": "Date + time"
        },
        {
            "key": "uuid",
            "label": "UUID / GUID"
        },
        {
            "key": "autoincrement",
            "label": "Auto-increment key"
        }
    ],
    "databases": [
        {
            "key": "sqlserver",
            "label": "SQL Server",
            "types": {
                "integer": "INT",
                "bigint": "BIGINT",
                "decimal": "DECIMAL(18,2)",
                "float": "FLOAT",
                "boolean": "BIT",
                "string_short": "NVARCHAR(255)",
                "string_long": "NVARCHAR(MAX)",
                "binary": "VARBINARY(MAX)",
                "date": "DATE",
                "time": "TIME",
                "timestamp": "DATETIME2",
                "uuid": "UNIQUEIDENTIFIER",
                "autoincrement": "IDENTITY(1,1)"
            }
        },
        {
            "key": "azure",
            "label": "SQL Azure",
            "types": {
                "integer": "INT",
                "bigint": "BIGINT",
                "decimal": "DECIMAL(18,2)",
                "float": "FLOAT",
                "boolean": "BIT",
                "string_short": "NVARCHAR(255)",
                "string_long": "NVARCHAR(MAX)",
                "binary": "VARBINARY(MAX)",
                "date": "DATE",
                "time": "TIME",
                "timestamp": "DATETIME2",
                "uuid": "UNIQUEIDENTIFIER",
                "autoincrement": "IDENTITY(1,1)"
            }
        },
        {
            "key": "oracle",
            "label": "Oracle",
            "types": {
                "integer": "NUMBER(10)",
                "bigint": "NUMBER(19)",
                "decimal": "NUMBER(18,2)",
                "float": "BINARY_DOUBLE",
                "boolean": "NUMBER(1)",
                "string_short": "NVARCHAR2(255)",
                "string_long": "NCLOB",
                "binary": "BLOB",
                "date": "DATE",
                "time": null,
                "timestamp": "TIMESTAMP",
                "uuid": "RAW(16)",
                "autoincrement": "GENERATED AS IDENTITY"
            }
        },
        {
            "key": "mysql",
            "label": "MySQL",
            "types": {
                "integer": "INT",
                "bigint": "BIGINT",
                "decimal": "DECIMAL(18,2)",
                "float": "DOUBLE",
                "boolean": "TINYINT(1)",
                "string_short": "VARCHAR(255)",
                "string_long": "LONGTEXT",
                "binary": "LONGBLOB",
                "date": "DATE",
                "time": "TIME",
                "timestamp": "DATETIME",
                "uuid": "CHAR(36)",
                "autoincrement": "AUTO_INCREMENT"
            }
        },
        {
            "key": "mariadb",
            "label": "MariaDB",
            "types": {
                "integer": "INT",
                "bigint": "BIGINT",
                "decimal": "DECIMAL(18,2)",
                "float": "DOUBLE",
                "boolean": "TINYINT(1)",
                "string_short": "VARCHAR(255)",
                "string_long": "LONGTEXT",
                "binary": "LONGBLOB",
                "date": "DATE",
                "time": "TIME",
                "timestamp": "DATETIME",
                "uuid": "CHAR(36)",
                "autoincrement": "AUTO_INCREMENT"
            }
        },
        {
            "key": "postgresql",
            "label": "PostgreSQL",
            "types": {
                "integer": "INTEGER",
                "bigint": "BIGINT",
                "decimal": "NUMERIC(18,2)",
                "float": "DOUBLE PRECISION",
                "boolean": "BOOLEAN",
                "string_short": "VARCHAR(255)",
                "string_long": "TEXT",
                "binary": "BYTEA",
                "date": "DATE",
                "time": "TIME",
                "timestamp": "TIMESTAMP",
                "uuid": "UUID",
                "autoincrement": "GENERATED AS IDENTITY"
            }
        },
        {
            "key": "sqlite",
            "label": "SQLite",
            "types": {
                "integer": "INTEGER",
                "bigint": "INTEGER",
                "decimal": "NUMERIC",
                "float": "REAL",
                "boolean": "INTEGER (0/1)",
                "string_short": "TEXT",
                "string_long": "TEXT",
                "binary": "BLOB",
                "date": "TEXT",
                "time": "TEXT",
                "timestamp": "TEXT",
                "uuid": "TEXT",
                "autoincrement": "INTEGER PRIMARY KEY AUTOINCREMENT"
            }
        },
        {
            "key": "db2",
            "label": "IBM DB2",
            "types": {
                "integer": "INTEGER",
                "bigint": "BIGINT",
                "decimal": "DECIMAL(18,2)",
                "float": "DOUBLE",
                "boolean": "SMALLINT (0/1)",
                "string_short": "VARCHAR(255)",
                "string_long": "CLOB",
                "binary": "BLOB",
                "date": "DATE",
                "time": "TIME",
                "timestamp": "TIMESTAMP",
                "uuid": "CHAR(16) FOR BIT DATA",
                "autoincrement": "GENERATED BY DEFAULT AS IDENTITY"
            }
        },
        {
            "key": "firebird",
            "label": "Firebird",
            "types": {
                "integer": "INTEGER",
                "bigint": "BIGINT",
                "decimal": "NUMERIC(18,2)",
                "float": "DOUBLE PRECISION",
                "boolean": "SMALLINT (0/1)",
                "string_short": "VARCHAR(255)",
                "string_long": "BLOB SUB_TYPE TEXT",
                "binary": "BLOB",
                "date": "DATE",
                "time": "TIME",
                "timestamp": "TIMESTAMP",
                "uuid": "CHAR(16) CHARACTER SET OCTETS",
                "autoincrement": "GENERATED BY DEFAULT AS IDENTITY"
            }
        },
        {
            "key": "informix",
            "label": "Informix",
            "types": {
                "integer": "INTEGER",
                "bigint": "BIGINT",
                "decimal": "DECIMAL(18,2)",
                "float": "FLOAT",
                "boolean": "SMALLINT (0/1)",
                "string_short": "VARCHAR(255)",
                "string_long": "CLOB",
                "binary": "BLOB",
                "date": "DATE",
                "time": "DATETIME HOUR TO SECOND",
                "timestamp": "DATETIME YEAR TO FRACTION(5)",
                "uuid": "CHAR(36)",
                "autoincrement": "SERIAL"
            }
        },
        {
            "key": "access",
            "label": "MS Access",
            "types": {
                "integer": "LONG INTEGER",
                "bigint": null,
                "decimal": "CURRENCY",
                "float": "DOUBLE",
                "boolean": "YES/NO",
                "string_short": "SHORT TEXT (255)",
                "string_long": "LONG TEXT",
                "binary": "OLE OBJECT",
                "date": "DATE/TIME",
                "time": "DATE/TIME",
                "timestamp": "DATE/TIME",
                "uuid": "SHORT TEXT (36)",
                "autoincrement": "AUTO NUMBER"
            }
        },
        {
            "key": "excel",
            "label": "MS Excel",
            "types": {
                "integer": "NUMBER",
                "bigint": "NUMBER",
                "decimal": "NUMBER",
                "float": "NUMBER",
                "boolean": "TRUE/FALSE",
                "string_short": "TEXT",
                "string_long": "TEXT",
                "binary": null,
                "date": "DATE",
                "time": "TIME",
                "timestamp": "DATE",
                "uuid": "TEXT",
                "autoincrement": null
            }
        },
        {
            "key": "foxpro",
            "label": "FoxPro / DBF",
            "types": {
                "integer": "INTEGER (I)",
                "bigint": null,
                "decimal": "NUMERIC(18,2) (N)",
                "float": "DOUBLE (B)",
                "boolean": "LOGICAL (L)",
                "string_short": "CHARACTER (C)",
                "string_long": "MEMO (M)",
                "binary": "GENERAL (G)",
                "date": "DATE (D)",
                "time": null,
                "timestamp": "DATETIME (T)",
                "uuid": "CHARACTER (C, 16)",
                "autoincrement": "INTEGER AUTOINC"
            }
        },
        {
            "key": "mongodb",
            "label": "MongoDB",
            "types": {
                "integer": "INT32",
                "bigint": "INT64",
                "decimal": "DECIMAL128",
                "float": "DOUBLE",
                "boolean": "BOOLEAN",
                "string_short": "STRING",
                "string_long": "STRING",
                "binary": "BINARY",
                "date": "DATE",
                "time": "STRING",
                "timestamp": "DATE",
                "uuid": "STRING",
                "autoincrement": null
            }
        },
        {
            "key": "cache",
            "label": "InterSystems Cache",
            "types": {
                "integer": "INTEGER",
                "bigint": "BIGINT",
                "decimal": "NUMERIC(18,2)",
                "float": "DOUBLE",
                "boolean": "TINYINT",
                "string_short": "VARCHAR(255)",
                "string_long": "LONGVARCHAR",
                "binary": "LONGVARBINARY",
                "date": "DATE",
                "time": "TIME",
                "timestamp": "TIMESTAMP",
                "uuid": "VARCHAR(36)",
                "autoincrement": "IDENTITY"
            }
        }
    ],
    "caveats": [
        {
            "key": "boolean",
            "title": "Boolean",
            "text": "SQL Server has no BOOLEAN (it uses BIT), Oracle and InterSystems Caché use NUMBER(1), MySQL and MariaDB use TINYINT(1), and SQLite stores 0/1 with no declared type. Confirm that TRUE/FALSE survive as 1/0 and that downstream code does not compare against the string \"true\"."
        },
        {
            "key": "autoincrement",
            "title": "Auto-increment keys",
            "text": "Mechanisms differ by engine: IDENTITY (SQL Server), AUTO_INCREMENT (MySQL, MariaDB), GENERATED AS IDENTITY or a sequence (Oracle, PostgreSQL, IBM DB2), AUTO NUMBER (MS Access), INTEGER AUTOINC (Visual FoxPro 8 and later; classic DBF has none) and nothing at all in Excel. Generated values normally restart at 1, so foreign keys stay consistent but code that depends on specific IDs will not."
        },
        {
            "key": "timestamp",
            "title": "Date and time",
            "text": "Oracle DATE already carries a time component; it is not date-only, so a date column may arrive with 00:00:00 attached. MS Access stores date and time in one Date/Time value. FoxPro T (datetime) was never widely supported, so legacy DBF files usually keep date and time in separate fields."
        },
        {
            "key": "uuid",
            "title": "UUID / GUID",
            "text": "No two engines agree: UNIQUEIDENTIFIER (SQL Server), RAW(16) (Oracle), CHAR(36) (MySQL, MariaDB), native UUID (PostgreSQL). SQL Server UNIQUEIDENTIFIER has a different byte order from the same GUID stored as text; if the value must be compared across systems, keep it as text."
        },
        {
            "key": "decimal",
            "title": "Fixed decimals",
            "text": "Check precision and scale, not just the type name. SQL Server DECIMAL tops out at 38 digits, MySQL and MariaDB at 65. Moving Oracle NUMERIC(30,10) into DECIMAL(18,2) rounds silently."
        },
        {
            "key": "string_short",
            "title": "Short strings",
            "text": "Oracle VARCHAR2 defaults to byte semantics, so a 255-byte width holds fewer characters once the text is multi-byte; declare CHAR semantics where the width matters. MS Access text fields cap at 255 characters and FoxPro character fields at 254 bytes, both of which truncate longer source values."
        },
        {
            "key": "string_long",
            "title": "Long text",
            "text": "TEXT, CLOB, NVARCHAR(MAX) and MEMO behave differently: many engines cannot index them without a prefix length, and SQL Server legacy TEXT/NTEXT is deprecated in favour of NVARCHAR(MAX)."
        },
        {
            "key": "binary",
            "title": "Binary",
            "text": "BLOB, BYTEA, VARBINARY(MAX) and Access OLE Object differ in size limits, and some drivers return an empty binary value as NULL (or the other way round), which breaks a NOT NULL constraint on the target."
        }
    ]
}
