Should you cluster on OrderDate? Measure one month of orders on three designs and see what each one costs in reads before you rebuild a table.
Exporting CSV Files Without Losing Leading Zeros or Dates
A postal code like 00501 turns into 501 in a spreadsheet. See where the zero is lost, how to build a correct CSV line, and why quotes alone do not help.
Scheduling an Agent Job for Weekday Office Hours Only
Stop a monitoring job from waking anyone at 3 AM. Build the schedule, decode the weekday mask, and see what the window does not cover.
Parsing File Name Dates to Find the Newest Backup With REGEXP_SUBSTR
A restore script that sorts names as text can grab a copy or a log file. Parse the dates first, drop the bad ones, and break ties on purpose.
Cohort Retention Tables in T-SQL: From Raw Events to a Grid
Build a retention grid from raw orders with five rows you can check by eye. Includes the DISTINCT rule and why unfinished months show NULL.
GETDATE vs SYSDATETIME: Precision of the Current Time
Compare SYSDATETIME with GETDATE and UTC time functions, understand datetime rounding, and choose a clear timestamp type and clock contract.
Date Boundaries With DATETRUNC and EOMONTH in SQL Server 2022
Use DATETRUNC and EOMONTH for month, quarter, and week boundaries in SQL Server 2022, including index-friendly half-open filters.







