Distinguish ROWS_PER_BATCH estimates from BULK INSERT commit batches, then review logging, locks, rejected rows, and atomic loading.
Logging Agent Jobs That Call Stored Procedures
Improve logging Agent jobs with procedure run records, start and end events, captured errors, step output, and history correlation.
Cleaning Currency Strings Into decimal Values
Convert currency strings into decimal amounts using known symbols, explicit parsing cultures, conversion checks, and rejection evidence.
EXISTS vs IN vs JOIN: Writing Semi-Joins
Compare EXISTS, IN, and JOIN for semi-joins, prevent duplicate customer rows, and handle NULL safely in exclusion queries.
DELETE TOP With ORDER BY: Removing the Oldest Rows First
Use DELETE TOP safely through an ordered CTE, preview oldest rows, apply a supporting index, and remove eligible rows in bounded batches.
Optimizer Timeouts: Reason for Early Termination in a Plan
Diagnose optimizer early termination in SQL Server plans, find cached timeouts with XML, and simplify queries using measured evidence.
Turning a Business Question Into a Query: Define the Metric First
Turn a business question into a tested T-SQL metric with explicit time zones, cancellations, returns, and a hand-checked sample.







