Another back to basics puzzle with UNION: run three queries using UNION ALL, ORDER BY and DISTINCT, then compare their execution plans.
SQL SERVER – Simple Puzzle with UNION
Try this simple puzzle with UNION and ORDER BY. Guess what each of the three queries returns, and see why one of them fails with Msg 108 and Msg 104.
SQL SERVER – Relationship with Parallelism with Locks and Query Wait – Question for You
In server properties, Locks and Query Wait sit under the Parallelism section next to MAXDOP and cost threshold. I do not know why. Do you?
SQL SERVER – Puzzle #1 – Querying Pattern Ranges and Wild Cards
Readers often ask about querying pattern ranges. Wild cards are the usual answer, but not everyone uses them well. Solve my puzzle for a chance to win a book.
SQL SERVER- Solution – SQL Puzzle of SET ANSI_NULL
The solution to my Puzzle of SET ANSI_NULL: why IN returns a row but NOT IN returns nothing when the list has a NULL, and how SET ANSI_NULLS ON explains it.
SQL SERVER – Solution to Puzzle – REPLICATE over 8000 Characters
Here is the answer to my puzzle on REPLICATE over 8000 characters, with a quick recap of the script and why the lengths come out the way they do.
SQL SERVER – How to use xp_sscanf in Real World Scenario?
I came across the extended stored procedure xp_sscanf and could not find a real world use for it. Here is how it works. Can you tell me where to use it?





