NUMERIC or INTEGER ?
Hi,
Is there any difference between NUMERIC and INTEGER datatype?
I am currently migrating my application from oracle to sqlserver hence i need to know the best equivalent:
Oracle
var_int int(38);
SQLServer:
@var_int numeric(38) or @var_integer integer
Please let me know the best equivalent
--Srik
[342 byte] By [
Srik] at [2008-2-10]
Srik
The basic different between numeric and interger is the size that u want to allocate to the fields
Just try to do this
--ERROR
create table test
(
p numeric(38),
x integer(38) --This will not table the width mean its fixed and it cannot be changed.
)
go
--CORRECT
create table test
(
p numeric(38),
x integer
)
go
and when u display the structure.
p numeric no 17 38 0 yes (n/a) (n/a) NULL
x int no 4 10 0 yes (n/a) (n/a) NULL
17 and 4 is the length of the field
38 and 10 is the precision of the fields respectively.
So it is better we use numeric instead of integer when converting Oracle to Sql server.
Hope this helps you