To find the slowest cached queries in SQL Server, rank each statement by its average elapsed time and keep its plan beside it. This post builds a small workload, reads sys.dm_exec_query_stats with the plan, and shows why a database filter on the sql text hides every ad hoc query.
sp_updatestats and Disabled Indexes: What Gets Updated
sp_updatestats and disabled indexes: the procedure updates statistics on disabled nonclustered indexes and skips a table whose clustered index is disabled. This post proves both, times the cost of disabled indexes against dropped ones on a million rows, and generates a targeted update that skips them.
Top N Plus Others: Grouping the Rest Into One Row
Create top N plus others summaries with deterministic category ranking, one remainder total, stable labels, and explicit display ordering.
Infinite Loop – SQL in Sixty Seconds #144
Lots of people wrote feedback about it and wanted me to explain in this video so I have built this new Video where I discuss Infinite Loop.
SQL SERVER – Change Database and Table Collation
To Change Database collation, I separate its default from existing character-column settings. The customer moved from case-insensitive to case-sensitive behavior.
WHILE 1 = 1 Loop in T-SQL: Run Forever, Stop Safely
A WHILE 1 = 1 loop never ends on its own, so every one needs a planned exit. This post builds a once-a-second sampler with three ways out, a stop flag, a round limit and a time limit, then shows how to stop a loop from a second window and what the recursion limit does.
Efficiency Trick – Query Shortcut – SQL in Sixty Seconds #143
I have built a new SQL in Sixty Seconds video which describes how Query Shortcut works and how we can change them. Let us learn today.







