简体   繁体   English

十进制超出范围

[英]Decimal out of range

I'm trying to store the decimal 140.2705893427 into a SQL Server 2012 table. 我正在尝试将十进制140.2705893427存储到SQL Server 2012表中。 The column has a data type of decimal(12, 10) but I get the error: 该列的数据类型为decimal(12, 10)但我收到错误:

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

Why is this? 为什么是这样?

decimal(12, 10) means 12 total digits, 10 of which may be after the decimal point. decimal(12, 10)表示总共12位,其中10位可能在小数点后面。

Your value of 140.2705893427 has 13 total digits, thus it is out of range. 您的值140.2705893427有13位数字,因此超出范围。

Read decimal and numeric (Transact-SQL) for documentation. 读取十进制和数字(Transact-SQL)以获取文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM