Detailed description of SQLSERVER ing between SQLSERVER and ORACLE Data Types and corresponding table arrangement

Source: Internet
Author: User
Oracle SQL Server is a common database type character data type CHARCHAR: it is a fixed length character data, but the maximum size in oracle is 2 kb, and the maximum length in SQL Server is 8 KB. The variable length character data type VARCHAR2VARCHAR: the maximum length in racle is 4 kb, and in SQLServer is 8 KB.

Oracle SQLServer Common Data Warehouse type character data type CHAR: all are fixed length character data, but the maximum size in oracle is 2 kb, the maximum length of SQLServer is 8 KB. The variable length data type is VARCHAR2 VARCHAR. The maximum length of racle is 4 kb. The maximum length of SQLServer is 8 KB.

Oracle SQLServer comparison

Common SQL ServerDataLibraryType

CharacterDataTypeCHAR: All characters with a fixed length, but the maximum size in oracle is 2 kb, and the maximum length in SQLServer is 8 KB.
Variable-length charactersDataTypeVARCHAR2 VARCHAR: the maximum length of racle is 4 kb, and the maximum length of SQLServer is 8 KB.
Character Set-based fixed-length string NCHAR: NCHAR, former, maximum, 2 kb, and later, maximum, 4 kb
Variable-length string NVARCHAR2 NVARCHAR Based on the character set: the maximum length is 4 kb.
Date and TimeDataTypeDATE has two formats: Datetime and Smalldatetime. in oracle, DMY can be adjusted in SQLSerser. The default format is MDY.
NumberTypeNUMBER (P, S) NUMERIC [P (, S)]: in Oracle, p represents the NUMBER of digits on the left of the decimal point, and s represents the NUMBER of digits on the right of the decimal point. In SQLServer, p represents the sum of the digits on both sides of the decimal point, and s represents the digits on the right of the decimal point.
NumberTypeDECIMAL (P, S) DECIMAL [P (, S)]: In racle, p represents the number of digits on the left of the DECIMAL point, and s represents the number of digits on the right of the DECIMAL point. In SQLServer, p represents the sum of the digits on both sides of the decimal point, and s represents the digits on the right of the decimal point.
IntegerTypeInteger int is the same as an INTEGERTypeThe storage size is 4 bytes.
Floating Point NumberTypeFLOAT
Real NumberTypeREAL


ORACLEDataType
CommonDataLibrary FieldTypeAs follows:

FieldTypeOther restrictions
CHAR fixed length string maximum length 2000 bytes
VARCHAR2 Variable Length string maximum length 4000 bytes can be indexed maximum length 749
NCHAR Character Set-based fixed-length string maximum length 2000 bytes
NVARCHAR2 variable-length string based on character set up to 4000 bytes
DATE (DATE-month-year) DD-MM-YY (HH-MI-SS)
LONG variable-length charactersDataA maximum length of 2 GB (231-1) is enough to store big part books.
RAW fixed-length binaryDataThe maximum length is 2000 bytes, which can store relatively small multimedia images and sounds.
Long raw binary with Variable LengthDataThe maximum length is 2 GB, which can store large multimedia image sounds.
BLOB large binary object (variable length) up to 4 GB
CLOB large CHARTypeData
NCLOB large NCHARTypeData
BFILE is stored inDataLarge binary files outside the library
ROWIDDataThe unique row number of the record in the table is 10 bytes ***********. *****. The format is * 0 or 1, which is stored in the index.
UROWID is stored in the index as above
NROWID binaryDataThe maximum length of the unique row number recorded in the table is 4000 bytes.
NUMBER (P, S) NUMBERTypeP indicates the total number of digits, and S indicates the decimal place.
DECIMAL (P, S) NumberTypeP indicates the total number of digits, and S indicates the decimal place.
INTEGERTypeInteger
FLOAT floating point numberType
NUMBER (38), Double Precision
REAL NumberType
NUMBER (63), higher accuracy

Note: Each table can have only one LONG or long raw column ,...........

Several common SQL Server and ORACLEDataTypeCorrespondingLinkTable

SQL Server and OracleDataTypeOfCorrespondingLink

CorrespondingLink: Ing from SQL Server to Oracle

Convert from ORACLE to SQLSERVER

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.