Decimal out of range

I am trying to save the decimal point 140.2705893427 in a SQL Server 2012 table. The column has the decimal(12, 10) data type decimal(12, 10) , but I get an error:

 {"Parameter value '140.2705893427' is out of range."} 

Why is this?

+7
c # sql-server-2012 entity-framework-5
source share
1 answer

decimal(12, 10) means 12 full digits, 10 of which can be after the decimal point.

Your value of 140.2705893427 has 13 full digits, so it is out of range.

Read decimal and numeric (Transact-SQL) for documentation.

+13
source share

All Articles