What database data type do I need to use to store a numerical value with 18 digits after the decimal place? I've tried double and float but it doesn't work it only shows 16 digits after the decimal place. I'm using MS SQL Server 2005 and 2008.

有帮助吗?

解决方案

Assuming your values are not too big, you want to use DECIMAL. Something like DECIMAL(20, 18) (adjust the first value for the total number of digits in the number).

You can read about it here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top