Hannah Vernon 🇨🇦

@hannahvernon.com

Row-Overflow and LOB: When a Row Leaves the Page A data page is 8 KB, and a single row is capped at 8,060 bytes of in-row data.[1] So what happens when you declare two varchar(5000) columns, or store a 20,000-character varchar(max), in a row that plainly cannot hold it? SQL Server does not refuse…

Row-Overflow and LOB: When a Row Leaves the Page

A data page is 8 KB, and a single row is capped at 8,060 bytes of in-row data.[1] So what happens when you declare two varchar(5000) columns, or store a 20,000-character varchar(max), in a row that plainly cannot hold it? SQL Server does not refuse the row; it moves part of it off the page and leaves a pointer behind.

sqlserverscience.com

The NULL Bitmap: How SQL Server Records Nullability Every SQL Server data row carries a NULL bitmap, even a table with no nullable columns. Find it on the page, watch the bits flip as columns go NULL, and see what it actually costs.

The NULL Bitmap: How SQL Server Records Nullability

Every SQL Server data row carries a NULL bitmap, even a table with no nullable columns. Find it on the page, watch the bits flip as columns go NULL, and see what it actually costs.

sqlserverscience.com

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 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.

sqlserverscience.com

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 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.

sqlserverscience.com

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 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.

sqlserverscience.com

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 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.

sqlserverscience.com

Can You Actually Downgrade to Standard Edition? Ask the Database First Since SQL Server 2016 SP1, sys.dm_db_persisted_sku_features over-reports edition features. How to read it before downgrading to Standard.

Can You Actually Downgrade to Standard Edition? Ask the Database First

Since SQL Server 2016 SP1, sys.dm_db_persisted_sku_features over-reports edition features. How to read it before downgrading to Standard.

sqlserverscience.com