I need to store on SQLServer 2008 R2 currency exchange rate data.
The application making use of this data is developed in C#. The column holding the currency exchange rate will be required to store conversions both ways-- meaning, I'd rather have a fixed precision but a variable scale.
What Data type should I choose on SQL Server that can be mapped to C# avoiding any data loss? I'm looking at MSDN supplied mappings matrix and I'm can't seem to find anything that I can safely handle.
I'm left with Decimal. However these offer fixed scales. And that's where I'm stumped:
If I'm required to store a number like 0.0104182
but also 123.673
, I've established a precision of 10 as my requirement. But how should I set a scale that can fully accommodate this precision?
For exchange rates I'd use decimal (19, 9) or so.
You have to allow for "telephone number" rates
Examples, at current rates 1 British Pound is
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With