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.
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
This post is part of the series. The contents page lists every part in order. In I took a DATETIME apart byte by byte: two 4-byte integers, a date counted from 1900 and a time…
How SQL Server Stores a DATETIME, Down to the Bytes
This post is part of the series. The contents page lists every part in order. 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…
DAG Failover Toolkit: Scripted Distributed AG Failovers with Validation Gates
In a previous post, we looked at how Distributed Availability Groups work, why the failover syntax says FORCE_FAILOVER_ALLOW_DATA_LOSS, and what a scripted runbook should cover. This post introduces the toolkit that puts all of that…
Lock Escalation, and Why You Shouldn’t Disable It!
Lock escalation affects every SQL Server database. Understanding when and why SQL Server escalates row-level locks to table locks and what you can do about it is essential knowledge for any DBA managing concurrent workloads.