DECIMAL(19,4)are functionally the same, they are stored differently on disk, and this is where it gets interesting. Let’s use a random amount of $ 4,513.19. Since it’s small enough to fit in both
SMALLMONEY, we can do a simple experiment. When we ask SQL Server to store this value in a
MONEYdata type, it will store it (byte-reversed) as
SMALLMONEYversion of this amount would look almost identical, stored as
0x7CA8B002(without the leading zeroes). A quick look at this byte-reversed value (
0x02B0A87C) in a hex calculator gives us the amount of 45,131,900. After moving the decimal point four places to the left, we get our starting value of 4513.1900.
But read on to see how that compares to other data types.