Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的值为 2800320,我需要将其插入到 numeric(9, 4) 数据类型的表中。在我给出的代码中float.Parse(record.Substring(i, 8))。当我插入到 sql 时发生算术溢出错误。请告诉如何纠正这个?
float.Parse(record.Substring(i, 8))
NUMERIC(9,4) 的意思是“一个总共有 9 位的数字,其中 4 位在小数点后”,这意味着您还有 5 位数字来存储您的 7 位数字 2800320
显然,这是行不通的。选择一个更大的数字,或将您的数字除以 100 或更多,这样它就适合了