十进制超出范围 [英] Decimal out of range

查看:70
本文介绍了十进制超出范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将十进制 140.2705893427 存储到SQL Server 2012表中.该列的数据类型为 decimal(12,10),但出现错误:

I'm trying to store the decimal 140.2705893427 into a SQL Server 2012 table. The column has a data type of decimal(12, 10) but I get the error:

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

这是为什么?

推荐答案

十进制(12,10)表示12位数字,其中10位可能在小数点后.

decimal(12, 10) means 12 total digits, 10 of which may be after the decimal point.

您的 140.2705893427 值有13位数字,因此超出范围.

Your value of 140.2705893427 has 13 total digits, thus it is out of range.

阅读十进制和数字(Transact-SQL)以获得文档.

这篇关于十进制超出范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆