Does SQL Server Support Custom Domains?
If you have spent time with PostgreSQL or Oracle, or read enough of the SQL standard to regret it, you have probably met the CREATE DOMAIN statement. A domain is a named, reusable type with…
Seeing Exactly Where SQL Server Stores Each Column
You add a couple of varchar(max) columns to a table because you are not sure how big the values will get. Most rows hold a few dozen characters. A handful hold tens of thousands. Everything…
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…