How SQL Server Stores MONEY and SMALLMONEY, and the Rounding Trap
money and smallmoney are just integers scaled by 10000. The real page bytes, why the ranges are what they are, and the four-decimal truncation trap that bites calculations.
How SQL Server Stores DECIMAL and NUMERIC, Down to the Bytes
decimal and numeric store a sign byte plus a little-endian integer scaled by the column scale. Why precision buys storage in tiers, and why an oversized decimal is not free.
How SQL Server Stores a GUID, and Why Random Ones Fragment
A uniqueidentifier is 16 bytes with a peculiar sort order. Why random GUIDs fragment as a clustering key, and how NEWSEQUENTIALID and design fix it.
How SQL Server Stores Strings: varchar, nvarchar, and What UTF-8 Changed
The same word can take 3, 5, 6, or 9 bytes depending on the type and collation. A byte-level look at varchar, nvarchar, and UTF-8 collations.
How SQL Server Stores DATETIME2, DATE, and TIME
In I took a DATETIME apart byte by byte: two 4-byte integers, a date counted from 1900 and a time counted in awkward three-hundredths of a second. That awkward tick is exactly what Microsoft set…
How SQL Server Stores a DATETIME, Down to the Bytes
Every DBA eventually asks the same odd little question. You insert ‘2024-03-14 09:26:53.999’, read it back, and it says 09:26:54.000 instead. Store a value ending in .456 and it comes back as .457. Nothing is…