SQL Server Science
Technical Articles for the DBA / Developer
Home » style guide

Why I Keep a T-SQL Style Guide, and What Testing It Cost Me

2026-09-14 · by Hannah Vernon · in t-sql

I keep a file of T-SQL conventions. Square brackets on identifiers, COALESCE over ISNULL, block comments, NOT EXISTS over NOT IN, and a dozen more. It is not there because consistent code is prettier. It…

The SET Succeeds and the Catalog Read Succeeds, Then Msg 3951

2026-09-13 · by Hannah Vernon · in t-sql

Snapshot isolation is the answer to most of the problems WITH (NOLOCK) gets used for, which I covered in . Readers stop waiting for writers, and unlike read uncommitted, everything they read was actually committed….

NOLOCK Returned a Balance That Never Existed

2026-09-12 · by Hannah Vernon · in t-sql

WITH (NOLOCK) gets added to queries for one reason: something was slow, or something was blocked, and the hint made the query run. It does make blocking stop. What it gives up in exchange is…

A Nested COMMIT Does Not Commit Anything

2026-09-11 · by Hannah Vernon · in t-sql

A procedure that opens its own transaction is fine on its own. Call it from another procedure that already opened one and the arithmetic stops matching your intent. SQL Server does not have nested transactions….

COUNT Under the Hood

2026-09-10 · by Hannah Vernon · in t-sql

COUNT() and COUNT_BIG() do the same thing: they return the total number of rows in your result set, or the number of rows-per-group with GROUP BY. Only COUNT_BIG() works when there are more than 2,147,483,647…

COALESCE in a WHERE Clause Costs You the Row Estimate

2026-09-09 · by Hannah Vernon · in t-sql

Optional filter parameters are everywhere in reporting procedures. Pass a value and you want that value; pass NULL and you want everything. This post is part of the series. The contents page lists every part…

1 2 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
  • Blog Series
    • Backup & Recovery from First Principles: Series Contents
    • Database as a Versioned Contract: Series Contents
    • Extended Events in Production: Series Contents
    • Git for DBAs: Series Contents
    • How SQL Server Stores Data: Series Contents
    • Logins, SIDs, and Kerberos from First Principles: Series Contents
    • Proving the Restore: Series Contents
    • T-SQL Style Guide, Tested: Series Contents
    • The UNKNOWN Problem: NULL Traps in T-SQL, Series Contents
    • Undocumented Changes in SQL Server 2022 and 2025: Series Contents
  • 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