A T-SQL brain trick: three SELECT statements are separated by lines of underscores, and running one of those lines alone gives Msg 2812. Can you explain why?
Puzzle – Usage of New Index Hints – ForceSeek and ForceScan
SQL Server Denali adds the FORCESCAN hint next to FORCESEEK. A weekend puzzle on these Index Hints: write a query where each one improves performance.
SQL SERVER – DBA Quiz 2011 – All was well few moments before all went wrong – Reasons and Resolutions
My question in DBA Quiz 2011 comes from a real incident: a query that always worked fine suddenly did not. Share your reasons and resolutions.
SQL SERVER – Puzzle Involving NULL – Resolve – Error – Operand data type void type is invalid for sum operator
SELECT SUM over a lone NULL throws Msg 8117: Operand data type void type is invalid for sum operator. Here is why it happens and how ISNULL fixes it.
SQL SERVER – Solution – Generating Zero Without using Any Numbers in T-SQL
Madhivanan asked how to get zero without using any numbers in T-SQL. Here are the clever reader answers, from SELECT $ to counting a NULL cast.
SQL SERVER – Solution – Puzzle – Statistics are not Updated but are Created Once
The solution to my puzzle on why statistics are not updated but are created once after a large insert, even with auto update on, and the fix that worked for me.
SQL SERVER – Solution – Puzzle – SELECT * vs SELECT COUNT(*)
The solution to my puzzle on why SELECT * throws an error but SELECT COUNT(*) does not, with the best reader answers and credit to Rob Farley.






