Anyone had an experience of handling multiple currencies? Current schema uses decimal (9, 2) so clearly won't handle currencies with 3 decimal places. Is there any advantage using money or smallmoney over say decimal (n, 3) ? Have Googled but results far from conclusive.
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Sql Money vs decimal data types
Collapse
X
-
-
Decimal is more flexible and can hold a greater range and precision.
Money is actually an integer that is fixed to 4 decimal places and so counts 0.0001, 0.0002, 0.0003 instead of 1,2,3.
I'd go with decimal or the new vardecimal type.
http://msdn.microsoft.com/en-us/libr...3(SQL.90).aspx -
Behold the warranty -- the bold print giveth and the fine print taketh away.Comment
-
Yes, I can't seem to see any great benefit from using money. It seems to encompass the currency symbol as well as the amount though it doesn't seem to handle different separators. Just as well do as you suggest & get the greater precision through decimal. This way, when I display the value on the page, I guess I'll get the right currency symbol, precision & separator formatting the value using the relevant CultureInfo.Comment
-
-
I'm not even talking SQL when I say that I have always found money data types more hassle than they are worth. Currency symbols/mnemonics can be a nightmare, especially where systems have different locale settings; you are better off controlling these yourself.Originally posted by wurzel View PostYes, I can't seem to see any great benefit from using money.Behold the warranty -- the bold print giveth and the fine print taketh away.Comment
-
If you are planning on storing GBP denominated currencies then I'd recommend you use 64-bit long (bigint) types.
HTHComment
-
Comment
-
The question was money type vs decimal.Originally posted by Durbs View PostUse Decimal or Numeric
(they both do the same thing, just choose the name you like best)
Crikey.Comment
-
The only benefits I can see to money over other data types either custom or base types is 1) It is then very clear regardless of column name what the column was designed to hold and 2) Using financial functions that expect money as inputs, you might find that the type used even if identical in dimensions and content to money gets converted before running through the function leading to performance issues. This may also be the case joining that field to others although you're unlikely to join money columns that frequently.Comment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers

Comment