# SQL SERVER – Difference and Explanation among DECIMAL, FLOAT and NUMERIC

The basic difference between Decimal and Numeric :
They are the exactly same. Same thing different name.

The basic difference between Decimal/Numeric and Float :
Float is Approximate-number data type, which means that not all values in the data type range can be represented exactly.
Decimal/Numeric is Fixed-Precision data type, which means that all the values in the data type reane can be represented exactly with precision and scale.

Converting from Decimal or Numeric to float can cause some loss of precision. For the Decimal or Numeric data types, SQL Server considers each specific combination of precision and scale as a different data type. DECIMAL(2,2) and DECIMAL(2,4) are different data types. This means that 11.22 and 11.2222 are different types though this is not the case for float. For FLOAT(6) 11.22 and 11.2222 are same data types.

Reference : Pinal Dave (https://blog.sqlauthority.com), BOL DataTypes

#### Related Posts

• Rebecca
April 10, 2013 9:35 pm

What do you mean by data-type reane?

• January 3, 2019 8:30 pm

ITS DATA TYPE RANGE DEAR

• shushraj
October 8, 2013 11:29 pm

Nice blog.very interesting topic, decimal float and numeric.

• ashish
January 27, 2015 4:47 pm

DECLARE @num float , @num1 Dec(19,2)
SET @num=950000.64
SET @num1=@num
SELECT CAST(@num1 as VARCHAR(18)),CAST(@num as VARCHAR(18)),@num

ideally all 3 should have same value. But I am getting different values..

• Ashish
February 25, 2015 12:20 pm

Even without using @num1 = @num, same reult is coming….

DECLARE @num float , @num1 Dec(19,2)
SET @num=950000.64
SET @num1=950000.64
SELECT CAST(@num1 as VARCHAR(18)),CAST(@num as VARCHAR(18)),@num

• Ashish
February 25, 2015 12:25 pm

I also observed that LEN() function is behaving differently for float & decimal data types..
Example:
declare @a float, @b float, @c decimal(19,2)
select @a = 350470.88, @b = 35070.88, @c = 350470.88
select @a A, @b B, @c C, LEN(@a) len_A, LEN(@b) len_B, LEN(@c) len_C

Ideally len_A & len_C should have same value…

• Bo
September 2, 2016 7:25 pm

In T-SQL, I have a table with Lat/Long stored in real data types. However they only show up at scale of 4 such as -110.8130 / 31.3580. When I convert the column data types to Decimal (18,8), all of Lat/Long become -110.81304932 / 31.35803986. Is there any way I can control the “display” precision/scale when looking at real data type?

• 