sqlserver2005表字段与其它数据库字段的对应关系
1.在Oracle中建立对应的contract和 contract_project表,需要同步哪些字段我们就建那些字段到Oracle表中。
这里需要注意的是Oracle的数据类型和SQLServer的数据类型是不一样的,那么他们之间是什么样的关系拉?我们可以在SQLServer下运行:
SELECT*
FROMmsdb.dbo.MSdatatype_mappings
SELECT*
FROMmsdb.dbo.sysdatatypemappings
来查看SQLServer和其他数据库系统的数据类型对应关系。第一个SQL语句是看SQL转Oracle的类型对应,而第二个表则更详细得显示了各个数据库系统的类型对应。根据第一个表和我们的SQLServer中的字段类型我们就可以建立好Oracle表了。
SQLServer和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 doubleprecision 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 doubleprecision 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 doubleprecision 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