Database: Mapping of datatypes (Sql Server and Oracle)

 

 

 HOME

 About Me

 Photo Collection

 Sign Guest Book

 Sanchit Blog

 Shristi - The creation!!!

 Google Search

 Infosys Technology

      

Google
Web sanchit.itgo.com
www.shristi.in

 

Data Type Mapping Between SQL Server and Oracle

Numbers:

Microsoft SQL Server

Oracle Database

Data type

Numeric type

Valid range

Data type

Bigint

Interger

-2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807)

NUMBER(19)

Int

Integer

-2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647)

NUMBER(10)

Smallint

Integer

-2^15 (-32,768) through 2^15 - 1 (32,767)

NUMBER(6)

Tinyint

Integer

-0 through 255

NUMBER(3)

Decimal(p,s)

Fixed Precision Decimal

-10^38 +1 through 10^38 �1

NUMBER(p,s)

Numeric(p,s)

See decimal

-10^38 +1 through 10^38 �1

NUMBER(p,s)

Money

Money(Accurate to 10000th Unit)

-2^63 (-922,337,203,685,477.5808) through 2^63 - 1 (+922,337,203,685,477.5807)

NUMBER(10,4)

Float

Floating Point

-3.40E + 38 through -1.18E - 38, 0 and 1.18E - 38 through 3.40E + 38

NUMBER

 



Character data types:

Microsoft SQL Server

Oracle Database

Data type

Type

Max Length (characters)

Data Type

Max Length (characters)

CHAR

Fixed-length

8000

CHAR

2000

VARCHAR

Variable-length

8000

VARCHAR2

4000

TEXT

Variable-length

2,147,483,647

CLOB

4,294,967,296

NCHAR

Fixed-length Unicode

4000

NCHAR

2000

NVARCHAR

Variable-length Unicode

4000

NVARCHAR2

4000

NTEXT

Variable-length Unicode

1,073,741,823

NCLOB

2,147,483,648

 
 

Binary data types:

Microsoft SQL Server

Oracle Database

Data type

Type

Max Length
(bytes)

Data Type

Max Length (bytes)

BIT

Bits

N

NUMBER(n)

38

BINARY

Fixed Length Binary

8000

BLOB

4 Gigabytes

VARBINARY

Variable Length Binary

8000

BLOB

4 Gigabytes

IMAGE

Variable Length Binary

2^31 - 1 (2,147,483,647)

BLOB

4 Gigabytes

 



 

Date data types:

Microsoft SQL Server

Oracle Database

Data type

Accuracy

Data type

Accuracy

DATETIME

3.33MS

DATE

1 s

DATETIME

3.33MS

TIMESTAMP (3)

1 ms

SMALLDATETIME

1 minute

DATE

1 s

 
 

Other data types:

Microsoft SQL Server

Oracle Database

Data type

Description

Data type

CURSOR

Cursor References

PL/SQL REF CURSOR

SQL_VARIANT

Stores values with different Microsoft SQL Server data types in a single column or variable.

SYS.ANYDATA

TABLE

Stores a result set for later processing.

PL/SQL Collection

TIMESTAMP

Version-stamping table rows

NUMBER

UNIQUEIDENTIFIER

Globally unique identifier (GUID).

NUMBER

 

For further information on data types:

SQL server : http://msdn.microsoft.com/library/en-us/tsqlref/ts_da-db_7msw.asp

Oracle:         http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm

 

Disclaimer:

Data collected from Internet. We are not copy write owner of this information. Thus no guaranty that data is up to date. Ownership and copy writes remains is with their respective owners. We are not responsible for any loss or liability incurred by using this information.

© Sanchit Kumar Mishra

Hosted by www.Geocities.ws

1