SQL Server货币数据类型需要更精确的数据

时间:2022-02-17 16:31:26

I am working on this old SQL Server database which store numeric values in MONEY datatype. This has been good for years, now for some currency rate conversions we need up to 10 decimal places. We are exploring the possible conversion from MONEY datatype to DECIMAL.

我正在处理这个旧的SQL Server数据库,它用货币数据类型存储数值。这多年来一直很好,现在对于一些汇率转换,我们需要最多10位小数。我们正在研究从货币数据类型到十进制的可能转换。

I see that a MONEY field is equivalent to a DECIMAL(19, 4). Would it be safe just use a broader DECIMAL(25, 10) to accommodate 10 decimal digits?

我看到一个货币字段等价于十进制(19,4)。仅仅使用一个更大的十进制(25,10)来容纳10个十进制数字是否安全?

What if we want ensure more space for future request, what would be the limit that would not fit anymore the Classic ASP application built on the database (using Double datatype)?

如果我们希望为将来的请求提供更多的空间,那么构建在数据库上的经典ASP应用程序(使用双数据类型)将不再适用什么限制呢?

Thanks

谢谢

1 个解决方案

#1


6  

you should define the type as decimal(25,10) which could hold the federal deficit up to an accuracy of 10 digits. (25 digits with ten after the decimal place).

您应该将类型定义为decimal(25,10),它可以将联邦赤字保持在10位数的精度。(小数点后10位25位)

#1


6  

you should define the type as decimal(25,10) which could hold the federal deficit up to an accuracy of 10 digits. (25 digits with ten after the decimal place).

您应该将类型定义为decimal(25,10),它可以将联邦赤字保持在10位数的精度。(小数点后10位25位)