SQL adaptation guide for SQL SERVER 2005, 2008, 2012, 2014, 2016 / Data dictionary |
Microsoft™ SQL SERVER offers numeric data types which are quite similar to Informix® numeric data types. This table shows general conversion rules for numeric data types:
Informix | Microsoft SQL SERVER |
---|---|
SMALLINT | SMALLINT |
INTEGER (synonym: INT) | INTEGER (synonym: INT) |
BIGINT | BIGINT |
INT8 | BIGINT |
DECIMAL[(p[,s])] (synonyms: DEC, NUMERIC) DECIMAL(p,s) defines a fixed point decimal where p is the total number of significant digits and s the number of digits that fall on the right of the decimal point. DECIMAL(p) defines a floating point decimal where p is the total number of significant digits. The precision p can be from 1 to 32. DECIMAL is treated as DECIMAL(16). |
DECIMAL[(p[,s)] (synonyms: DEC, NUMERIC) DECIMAL[(p[,s])] defines a fixed point decimal where p is the total number of significant digits and s the number of digits that fall on the right of the decimal point. The maximum precision is 38. Without any decimal storage specification, the precision defaults to 18 and
the scale defaults to zero:
|
MONEY[(p[,s]) | SQL SERVER provides the MONEY and SMALLMONEY data types, but the currency symbol handling is quite different. Therefore, Informix MONEY columns should be implemented as DECIMAL columns in SQL SERVER. |
SMALLFLOAT (synonyms: REAL) | REAL |
FLOAT[(n)] (synonyms: DOUBLE PRECISION) The precision (n) is ignored. |
FLOAT(n) (synonyms: DOUBLE PRECISION) Where n must be from 1 to 15. |
When creating tables from BDL programs, the database interface automatically converts Informix numeric data types to corresponding Microsoft SQL SERVER data types.