
Applies to SQL Server 2019, 2022 and 2025.
Money vs decimal is one of those design choices that gets made once, when a table is created, and then lives with you for years. SQL Server has a data type called money, so it seems obvious to use it for prices and totals. It works fine for storing amounts and adding them up. The trouble starts when you divide or multiply, and that is where I have seen reports quietly lose pennies.
What the money and smallmoney types are
Money is a fixed-point type with exactly four decimal places. It takes 8 bytes and holds values from about minus 922 trillion to plus 922 trillion. Its little brother, smallmoney, takes 4 bytes and only goes from -214,748.3648 to 214,748.3647, which is too small for most real totals; I never use it.
Decimal (or numeric, which is the same thing) lets you choose the precision and scale yourself. For currency I mostly use decimal(19,4): the same four decimal places as money, a similar range, and 9 bytes of storage. If you only ever deal in pounds and pence, decimal(19,2) is fine too.
Money also has one convenience decimal lacks: converting text to money accepts currency symbols and commas. I covered that, and the traps that come with it, in Converting Money in T-SQL.
Money vs decimal in arithmetic
Here’s a small example you can run as it is. Two regions, the same amounts stored both ways, and a query that works out each region’s share of the total as a percentage:
CREATE TABLE #Sales
(
Region varchar(10) NOT NULL,
AmountMoney money NOT NULL,
AmountDecimal decimal(19,4) NOT NULL
);
INSERT #Sales (Region, AmountMoney, AmountDecimal)
VALUES ('North', 100, 100),
('South', 239, 239);
SELECT Region,
AmountMoney / SUM(AmountMoney) OVER () * 100 AS PctMoney,
AmountDecimal / SUM(AmountDecimal) OVER () * 100 AS PctDecimal
FROM #Sales
ORDER BY Region;
DROP TABLE #Sales;
On SQL Server 2025 this returns 29.4900 and 70.5000 for the money column, which add up to 99.99. The decimal column gives 29.4985… and 70.5014…, which add up to 100 as they should.
The reason is that money divided by money gives money, and money only has four decimal places. So 100 / 339 is rounded to 0.2949 straight away, before the multiply by 100 happens. Every step of a money calculation is rounded to four places, and those small errors are then scaled up by whatever comes next. Decimal division works out a result type with a much larger scale, so the intermediate value keeps its precision.
The common mistake
The mistake is assuming that because the stored values are exact to the penny, any calculation on them will be too. People test with a sum or a simple subtraction, see the right answer, and move on. Addition and subtraction are fine with money. Division is where it goes wrong: percentages, allocating a cost across departments, working out a unit price from a pack price, converting currencies with an exchange rate held as money.
The second half of the mistake is the “fix” of adding 100.0 at the end of the expression. That doesn’t help, because the damage was done by the division before the literal is reached:
DECLARE @Amount money = 100,
@Total money = 339;
SELECT @Amount / @Total * 100 AS AllMoney, -- 29.4900
@Amount / @Total * 100.0 AS LiteralAfter, -- 29.49000
CAST(@Amount AS decimal(19,4)) / @Total * 100 AS CastFirst; -- 29.4985...
If you’re stuck with money columns in an existing design, cast to decimal before the first division, as in the last column. Once one side of the division is decimal, SQL Server works the whole expression out in decimal.
Which one I use
For new tables I use decimal for anything that will be divided, multiplied by a rate or shared out. I don’t bother changing existing money columns that are only ever summed and displayed; that’s a lot of work for no gain. What I do change is the code, so calculations cast to decimal first.
Decimal isn’t magic either. When precision gets near the maximum of 38, SQL Server can cut the scale of a result down to as few as 6 places, so very long chains of multiplication and division can still round. For normal business maths it’s more than enough, and the rules are documented in Microsoft’s page on precision, scale and length.
Watch out for
- Division and multiplication on money. Each step rounds to four decimal places. Cast to decimal before the first divide.
- Totals that don’t add up. Percentages or allocations that come to 99.99 or 100.01 are the usual sign of money arithmetic.
- smallmoney limits. Anything over 214,748.3647 gives an arithmetic overflow error, which tends to turn up the first time someone enters a big order.
- Rounding on the way in. Money keeps four decimal places, so 1234.56789 is stored as 1234.5679 without any warning.
- Mixed types in one table. Money in one column and decimal in another makes every calculation harder to reason about. Pick one and stick to it.
Microsoft’s pages on money and smallmoney and decimal and numeric give the full ranges and storage sizes. For more of my day-to-day notes, see the SQL Server DBA Handbook.
This topic came up in the SQLServerCentral Question of the Day: Representing Money.
Clive Roberts DBA