Generate recurring events with stable weekday arithmetic, monthly ranking, and anchored fourteen-day rules instead of endless date rows.
SQL SERVER – Find Out Current Language of the Session
How do you find the current language setting of your session? A reader asked me, and @@LANGID with sys.syslanguages gives the answer in one short query.
Finding Free Time Slots in a Calendar With GENERATE_SERIES
Find free time slots with GENERATE_SERIES, exclude overlapping bookings, and merge busy intervals before calculating calendar gaps.
SQL SERVER – Measuring the Length of VARCHAR and NVARCHAR Columns with COL_LENGTH
Does an NVARCHAR column take twice the space of VARCHAR? Yes. I measure the length of VARCHAR and NVARCHAR columns with COL_LENGTH to show it.
Multi-Statement Table-Valued Functions and Interleaved Execution
See how interleaved execution corrects estimates for multi-statement table-valued functions and when an inline rewrite wins.
How to Trim TIME Part in DATETIME Values? – Interview Question of the Week #200
How to trim TIME part in DATETIME values? A reader wanted to keep only the date and the hour, so here are ways to cut off the minutes and seconds.
SQL Server – Formatted Date and Alias Name in ORDER BY Clause
Format a date with CONVERT, then use its alias in ORDER BY, and the rows come back in a different order. Here is a simple example of this formatted date surprise.







