SQL Server (TSQL) vs. Oracle (PLSQL) Data Types
SQL Server | Oracle |
Exact Numerics | |
TINYINT | NUMBER(3) |
SMALLINT | NUMBER(5) |
INTEGER | NUMBER(10) |
BIGINT | NUMBER(19) |
DECIMAL(p,s) | NUMBER(p,s) |
NUMERIC(p,s) | NUMBER(p,s) |
SMALLMONEY | NUMBER(10,4) |
MONEY | NUMBER(19,4) |
Approximate Numerics | |
REAL | BINARY_FLOAT |
FLOAT | BINARY_DOUBLE |
Date Time | |
SMALLDATETIME | TIMESTAMP(3) |
DATETIME | TIMESTAMP(3) |
DATETIME2(fs) | TIMESTAMP(fs) |
DATETIMEOFFSET(fs) | TIMESTAMP (fs) WITH TIME ZONE |
DATETIMEOFFSET(fs) | TIMESTAMP (fs) WITH LOCAL TIME ZONE |
Character strings | |
CHAR(x) | CHAR(x) |
VARCHAR(x) | ARCHAR2(x) |
VARCHAR(MAX) | CLOB |
TEXT | LONG |
Binary strings | |
BINARY(n) | RAW(n) |
VARBINARY(n) | LONG RAW |
VARBINARY(MAX) | LONG RAW or BLOB |
IMAGE | LONG RAW |
Binary strings | |
XML | XMLTYPE |
BIT | NUMBER(1) |
TIMESTAMP | ORA_ROWSCN pseudo column |
UNIQUEIDENTIFIER | RAW(16) |
N/A | BFILE |