OFFSET FETCH reads a block of rows from the middle of a sorted result. The demo returns rows 21 to 30, builds pages from a page number and measures why deep pages cost more. A seek based alternative reads the same two pages every time.
Frequently Run Stored Procedures: Find Them in the Cache
Frequently run stored procedures leave an execution count in the plan cache. A tested demo ranks three procedures by count, reads and calls per minute. It also shows what the cache forgets and when to use Query Store instead.
How to Write in Text File from T-SQL in SQL Server? – Interview Question of the Week #236
Question: How to Write in Text File from T-SQL in SQL Server?
The question above was actually asked in an interview and also was not asked in the same word.
Fewest Logical Reads: The Answer to the Delete Qualified Rows Puzzle
The fewest logical reads for the multiple table delete puzzle come from reading each table as few times as the rules allow. A string of student IDs gets to 4 reads. A set based delete needs 5 and is the one to use. The starting script needed 19.
How to Remove Quotes of QUOTENAME? – Interview Question of the Week #235
Question: How to Remove Quotes of QUOTENAME? I received based on my yesterday’s blog post SQL SERVER – QUOTENAME Function and Custom Quote Character.
QUOTENAME Function: Custom Quote Characters and Dynamic SQL
The QUOTENAME function turns a name into a safe identifier and doubles any closing delimiter inside it. Tested queries show which quote characters work, the 128 character limit and a dynamic SQL example. A short card lists the rules.







