Blaming the user is the oldest joke in IT. Here’s why it fails, and how NOT NULL, CHECK, UNIQUE and foreign keys stop bad data before it lands.
OPTIMIZE FOR and RECOMPILE Hints Compared
OPTIMIZE FOR and RECOMPILE address parameter-sensitive plans differently; compare stable representative values with per-run compilation cost.
Keyset Paging: Continue After a Date and ID Cursor
Keyset paging continues after a saved ordering key instead of counting past an offset. A date and unique ID together keep equal-date rows in the sequence. A guarded disposable fixture makes the boundary conditions explicit.
SQL SERVER – SELECT * FROM dual – Dual Equivalent
Oracle developers often miss the DUAL table in SQL Server. I explain what DUAL is, why SELECT * FROM dual fails with Msg 208, and the dual equivalent to use.
SQL SERVER – Identifying Statistics Used by Query
Can you find the statistics used by query? There is no direct tool or DMV for it, but I explain an indirect way through the indexes a query uses.
Fast Exports With bcp
Fast exports with bcp compares native and character files, shows a format file, and explains where batch size helps and how to check a large export.
Fixing Invalid Geography Polygons and Ring Orientation
Diagnose invalid geography polygons with STIsValid and IsValidDetailed, repair with MakeValid, and check ring orientation and EnvelopeAngle.
SQL SERVER – Datetime Function TODATETIMEOFFSET Example
A quick example of the datetime function TODATETIMEOFFSET in SQL Server, and how it differs from SWITCHOFFSET when offsets change.
SQL SERVER – Datetime Function SWITCHOFFSET Example
SWITCHOFFSET changes a datetimeoffset value from its stored time zone offset to a new one. Here is a quick example of how it works in SQL Server 2008.
Row Goals: Why TOP and EXISTS Change the Plan
Inspect row goals from TOP and EXISTS, read EstimateRowsWithoutRowGoal, and compare a targeted optimizer hint using actual plans.










