Resource bottlenecks hide in the wait statistics, under a pile of idle waits and totals since startup. This post builds a script that removes the idle waits, measures an interval and groups the rest by resource. It also explains how to read each group and the signal wait.
SQL SERVER – Puzzle – Playing with Datetime with Customer Data
Playing with Datetime became a puzzle when one conversion worked for a customer but failed for me. The input was unchanged.
SQL SERVER – Understanding How to Play With Row Constructor
A code review surprised me with an unusual use of the Row Constructor. Here is what the code did and how you can play with row constructors yourself.
How to Find Recent Executed Queries in SQL Server? – Interview Question of the Week #087
An interview question that stumped candidates: how do you find recent executed queries in SQL Server? A DMV script using sys.dm_exec_query_stats answers it.
SQL SERVER – Find Week of the Year Using DatePart Function
The DATEPART function returns a week number according to its week definition. I choose that convention before using calendar logic.
Finding Orphaned Child Rows Before Adding a Foreign Key
Find orphaned child rows before adding a foreign key, review their business meaning, validate relationships, and confirm constraint trust.







