Ronald,
You would want to use the Decimal type, as it will give you the
precision you need. This is what you would use in .NET code.
For the database, you can use the money class, assuming that you are not
going to store more than 1/10000th of your currency unit. While I don't
know of any currencies that have 0 decimal places, I imagine that they used
four decimal places in case you are storing intermediate values which will
have operations performed on them before they are returned to the user.
If you have a need for greater precision in the database, then you can
use the decimal type, and indicate the precision and scale yourself.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Ronald S. Cook" <rc***@westinis.comwrote in message
news:en**************@TK2MSFTNGP04.phx.gbl...
For money values, C# seems to have just DOUBLE as a type.
SQL Server 2005 has data types DECIMAL, FLOAT, MONEY, and NUMERIC that
seem to all be able to hold a money time.
So, given I'll be storing money as a double in code, what datatype should
I have in the database for when I pass the value. I.e. which of all the
SQL types best matches up?
Thanks,
Ron