Oracle的数据类型和SQLServer的数据类型转换
今天在做SQLServer2005数据库到Oracle数据库的迁移,需要注意的是Oracle的数据类型和SQLServer的数据类型是不一样的,可以在SQLServer下运行:
SELECT *
FROM msdb.dbo.MSdatatype_mappings
SELECT *
FROM msdb.dbo.sysdatatypemappings
来查看SQLServer和其他数据库系统的数据类型对应关系。第一个SQL语句是看SQL转Oracle的类型对应,而第二个表则更详细得显示了各个数据库系统的类型对应。
ORACLE bigint NUMBER 19 3 1 ORACLE binary BLOB NULL 0 1
ORACLE binary RAW -1 4 1
ORACLE bit NUMBER 1 3 1
ORACLE char CHAR -1 4 1
ORACLE char CLOB NULL 0 1
ORACLE char VARCHAR2 -1 4 1
ORACLE datetime DATE NULL 0 1
ORACLE decimal NUMBER -1 3 1
ORACLE double precision FLOAT NULL 0 1
ORACLE float FLOAT NULL 0 1
ORACLE image BLOB NULL 0 1
ORACLE int NUMBER 10 3 1
ORACLE money NUMBER 19 3 1
ORACLE nchar NCHAR -1 4 1
ORACLE nchar NCLOB NULL 0 1
ORACLE ntext NCLOB NULL 0 1
ORACLE numeric NUMBER -1 3 1
ORACLE nvarchar NCLOB NULL 0 1
ORACLE nvarchar NVARCHAR2 -1 4 1
ORACLE nvarchar(max) NCLOB NULL 0 1
ORACLE real REAL NULL 0 1
ORACLE smalldatetime DATE NULL 0 1
ORACLE smallint NUMBER 5 3 1
ORACLE smallmoney NUMBER 10 3 1
ORACLE sysname NVARCHAR2 128 4 1
ORACLE text CLOB NULL 0 1
ORACLE timestamp RAW 8 4 1
ORACLE tinyint NUMBER 3 3 1
ORACLE uniqueidentifier CHAR 38 4 1
ORACLE varbinary BLOB NULL 0 1
ORACLE varbinary RAW -1 4 1
ORACLE varbinary(max) BLOB NULL 0 1
ORACLE varchar CLOB NULL 0 1
ORACLE varchar VARCHAR2 -1 4 1
ORACLE varchar(max) CLOB NULL 0 1
ORACLE xml NCLOB NULL 0 1
ORACLE bigint NUMBER 19 3 1
ORACLE binary BLOB NULL 0 1
ORACLE binary RAW -1 4 1
ORACLE bit NUMBER 1 3 1
ORACLE char CHAR -1 4 1
ORACLE char CLOB NULL 0 1
ORACLE char VARCHAR2 -1 4 1
ORACLE datetime DATE NULL 0 1
ORACLE decimal NUMBER -1 3 1
ORACLE double precision FLOAT NULL 0 1
ORACLE float FLOAT NULL 0 1
ORACLE image BLOB NULL 0 1
ORACLE int NUMBER 10 3 1
ORACLE money NUMBER 19 3 1
ORACLE nchar CHAR -1 4 1
ORACLE nchar CLOB NULL 0 1
ORACLE ntext CLOB NULL 0 1
ORACLE numeric NUMBER -1 3 1
ORACLE nvarchar CLOB NULL 0 1
ORACLE nvarchar VARCHAR2 -1 4 1
ORACLE nvarchar(max) CLOB NULL 0 1
ORACLE real REAL NULL 0 1
ORACLE smalldatetime DATE NULL 0 1
ORACLE smallint NUMBER 5 3 1
ORACLE smallmoney NUMBER 10 3 1
ORACLE sysname VARCHAR2 128 4 1
ORACLE text CLOB NULL 0 1
ORACLE timestamp RAW 8 4 1
ORACLE tinyint NUMBER 3 3 1
ORACLE uniqueidentifier CHAR 38 4 1
ORACLE varbinary BLOB NULL 0 1
ORACLE varbinary RAW -1 4 1
ORACLE varbinary(max) BLOB NULL 0 1
ORACLE varchar CLOB NULL 0 1
ORACLE varchar VARCHAR2 -1 4 1
ORACLE varchar(max) CLOB NULL 0 1
ORACLE xml CLOB NULL 0 1
ORACLE bigint NUMBER 19 3 1
ORACLE binary BLOB NULL 0 1
ORACLE binary RAW -1 4 1
ORACLE bit NUMBER 1 3 1
ORACLE char CHAR -1 4 1
ORACLE char CLOB NULL 0 1
ORACLE char VARCHAR2 -1 4 1
ORACLE datetime DATE NULL 0 1
ORACLE decimal NUMBER -1 3 1
ORACLE double precision FLOAT NULL 0 1
ORACLE float FLOAT NULL 0 1
ORACLE image BLOB NULL 0 1
ORACLE int NUMBER 10 3 1
ORACLE money NUMBER 19 3 1
ORACLE nchar NCHAR -1 4 1
ORACLE nchar NCLOB NULL 0 1
ORACLE ntext NCLOB NULL 0 1
ORACLE numeric NUMBER -1 3 1
ORACLE nvarchar NCLOB NULL 0 1
ORACLE nvarchar NVARCHAR2 -1 4 1
ORACLE nvarchar(max) NCLOB NULL 0 1
ORACLE real REAL NULL 0 1
ORACLE smalldatetime DATE NULL 0 1
ORACLE smallint NUMBER 5 3 1
ORACLE smallmoney NUMBER 10 3 1
ORACLE sysname NVARCHAR2 128 4 1
ORACLE text CLOB NULL 0 1
ORACLE timestamp RAW 8 4 1
ORACLE tinyint NUMBER 3 3 1
ORACLE uniqueidentifier CHAR 38 4 1
ORACLE varbinary BLOB NULL 0 1
ORACLE varbinary RAW -1 4 1
ORACLE varbinary(max) BLOB NULL 0 1
ORACLE varchar CLOB NULL 0 1
ORACLE varchar VARCHAR2 -1 4 1
ORACLE varchar(max) CLOB NULL 0 1
ORACLE xml NCLOB NULL 0 1