SQL Server Science
Technical Articles for the DBA / Developer
Home » Internals » Page 3

How SQL Server Stores DATETIME2, DATE, and TIME

2026-06-22 · by Hannah Vernon · in Internals

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

2026-06-21 · by Hannah Vernon · in Internals

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…

DAG Failover Toolkit: Scripted Distributed AG Failovers with Validation Gates

2026-06-07 · by Hannah Vernon · in Internals

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!

2026-04-30 · by Hannah Vernon · in Internals, performance

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.

Should I use (max) size for all my nvarchar/varchar columns?

2026-04-29 · by Hannah Vernon · in Internals, performance, t-sql

Should you use VARCHAR(MAX) for all your string columns? No. Here’s why MAX costs you indexing, memory grants, and storage efficiency with demos you can run yourself.

Identifying the Physical Location of a Row

2020-02-17 · by Hannah Vernon · in Internals

Occasionally I’ve needed to determine the physical location of a row stored in SQL Server. The code in this post uses the undocumented feature, %%PHYSLOC%%, which returns a binary representation in hexadecimal of the location…

« Previous 1 2 3 4 … 6 Next »

Search

Categories

  • AI for DBAs
  • announcements
    • events
  • basics
    • localization
  • configuration
  • Data Architecture
  • DMVs
  • documentation
  • extended-events
  • Git for DBAs
  • High Availability
  • Hot Takes
  • Internals
  • maintenance
    • patching
  • Opinion
  • performance
  • PostgreSQL
  • Professional Development
  • recovery
  • reporting
  • ROLLBACK;
  • security
    • data security
  • service broker
  • SQL Server Agent
  • statistics
  • sys
  • t-sql
    • xml
  • tools
    • data masking
    • wsus
  • troubleshooting
  • Uncategorized

Pages

  • About SQL Server Science
  • Get Better Help with a Minimal, Complete, and Verifiable Example, or MCVE
  • Privacy Policy

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.

To find out more, including how to control cookies, see here: Cookie Policy

Copyright © 2026 SQL Server Science