SQL adaptation guide For SQL SERVER 2005, 2008, 2012 / Data dictionary |
Informix data types | SQL SERVER data types (<2008) | SQL SERVER data types (>=2008) |
---|---|---|
CHAR(n) | CHAR(n) (limit = 8000b!) | CHAR(n) (limit = 8000b!) |
VARCHAR(n[,m]) | VARCHAR(n) (limit = 8000b!) | VARCHAR(n) (limit = 8000b!) |
LVARCHAR(n) | VARCHAR(n) (limit = 8000b!) | VARCHAR(n) (limit = 8000b!) |
NCHAR(n) | NCHAR(n) (UNICODE, limit = 4000c!) | NCHAR(n) (UNICODE, limit = 4000c!) |
NVARCHAR(n[,m]) | NVARCHAR(n)(UNICODE, limit = 4000c!) | NVARCHAR(n) (UNICODE, limit = 4000c!) |
BOOLEAN | BIT | BIT |
SMALLINT | SMALLINT | SMALLINT |
INT / INTEGER | INTEGER | INTEGER |
BIGINT | BIGINT | BIGINT |
INT8 | BIGINT | BIGINT |
SERIAL[(start)] | INTEGER (see notes) | INTEGER (see notes) |
BIGSERIAL[(start)] | BIGINT (see notes) | BIGINT (see notes) |
SERIAL8[(start)] | BIGINT (see notes) | BIGINT (see notes) |
DOUBLE PRECISION / FLOAT[(n)] | FLOAT(n) | FLOAT(n) |
REAL / SMALLFLOAT | REAL | REAL |
NUMERIC / DEC / DECIMAL(p,s) | DECIMAL(p,s) | DECIMAL(p,s) |
NUMERIC / DEC / DECIMAL(p) with p<=19 | DECIMAL(2*p,p) | DECIMAL(2*p,p) |
NUMERIC / DEC / DECIMAL(p) with p>19 | N/A | N/A |
NUMERIC / DEC / DECIMAL | DECIMAL(32,16) | DECIMAL(32,16) |
MONEY(p,s) | DECIMAL(p,s) | DECIMAL(p,s) |
MONEY(p) | DECIMAL(p,2) | DECIMAL(p,2) |
MONEY | DECIMAL(16,2) | DECIMAL(16,2) |
DATE | DATETIME | DATE |
DATETIME HOUR TO MINUTE | DATETIME | TIME(0) |
DATETIME HOUR TO FRACTION(n) | DATETIME | TIME(n) |
DATETIME YEAR TO SECOND | DATETIME | DATETIME2(0) |
DATETIME q1 TO q2 (different from above) | DATETIME | DATETIME2(n) |
INTERVAL q1 TO q2 | CHAR(50) | CHAR(50) |
TEXT | VARCHAR(MAX) |
VARCHAR(MAX) |
BYTE | VARBINARY(MAX) |
VARBINARY(MAX) |