Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server data types equivalent to Oracle?

I have Oracle 10g database table as a source. I'm planning to extract data from this table and insert into SQL Server table. Oracle table contains these data types

NUMBER
NUMBER(2, 7)
LONG

Which are equivalent data types to these in SQL Server?

like image 629
juur Avatar asked Mar 30 '11 17:03

juur


1 Answers

I was dealing a lot with importing exporting data in and our of MSSQL <-> Oracle and the simplest but also most accurate representation of a data type comparison was this one: http://download.oracle.com/docs/cd/B19306_01/gateways.102/b14270/apa.htm

In your case you need to do the following:

  • analyse the the field with the type NUMBER and try to find the scale/precision (might be server default values)
  • if you can't figure it out, analyze the values in the column and retrieve the maximum scale and precision from that
  • Then create a NUMERIC field with that scale/precision in your MSSQL table

In General, the simplest way an oracle NUMBER is represented by the NUMERIC type. But in some cases the values are actually boleans, integers etc.

like image 74
ntziolis Avatar answered Oct 13 '22 21:10

ntziolis