Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between Numeric and int

Status
Not open for further replies.

Zirak

MIS
Joined
Feb 3, 2003
Messages
164
Location
US
Hi,
I read most of the stuff on the web and Books on line, but I can't quite get the difference between "numeric" and "integer" data types.
 
Here is an extract from BOL:


Exact Numerics

Integers
bigint

Integer (whole number) data from -2^63 (-9223372036854775808) through 2^63-1 (9223372036854775807).

int

Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).

smallint

Integer data from 2^15 (-32,768) through 2^15 - 1 (32,767).

tinyint

Integer data from 0 through 255.

bit
bit

Integer data with either a 1 or 0 value.

decimal and numeric
decimal

Fixed precision and scale numeric data from -10^38 +1 through 10^38 –1.

numeric

Functionally equivalent to decimal.

 
Integer is a whole number from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647). Integer
, where numeric is Fixed precision and scale data from -10^38 +1 through 10^38 –1.
 
Integer is a whole number from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647). Integer Has a length of 4 bytes
, where numeric is Fixed precision and scale data from -10^38 +1 through 10^38 - 1 and length depends on precision and scale. Numeric or decimal used for amounts, currency. You can set numeric and decimal to different size using cast and convert functions. You also may round this data type.
Integer is a whole number, used for numeric fields like refference number, code, record number etc.



 
In the simplest terms possible, numeric has decimal places, integer does not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top