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…
Upgrading Database Compatibility Levels Across a Whole Instance
The instance upgrade went perfectly. You moved from SQL Server 2019 to 2022, the installer turned green, the services came back up, and the application connected on the first try. A week later someone asks…
Why Resource Governor Ignores Your SQL Server Agent Job Owner
You did everything right. Resource Governor is configured, you have a workload group that caps CPU and memory so one runaway job cannot starve everything else, and you have a classifier function that reads the…
IS DISTINCT FROM: Comparing NULLs Without the Headache
It usually shows up in a code review. Someone writes a filter that is supposed to exclude voided rows, it looks completely reasonable, and yet a tester swears that records are going missing. The query…
Self-Contained Transaction Scripts in SQL Server: the @debug_only Pattern
A safer alternative to the commented-out COMMIT habit: a @debug_only flag, SET XACT_ABORT ON, a named transaction, and an XACT_STATE guard that never leaves a transaction open.
COMMIT, ROLLBACK, and Autocommit: PostgreSQL Transactions for SQL Server DBAs
SQL Server DBAs lean on the ‘run to the SELECT, then COMMIT or ROLLBACK by hand’ workflow. PostgreSQL’s autocommit, abort-on-error, and plpgsql change the rules. Here is how to get the same safety and diagnostics in psql and pgAdmin.