This First Name From Full Name puzzle excludes CHARINDEX and SUBSTRING. It came from a customer query during a performance health check.
SQL SERVER – Puzzle – Strange Behavior With Extra Comma in Create Table Statement
My favorite icebreaker puzzle: a strange behavior with an extra comma in CREATE TABLE statement. Why does SQL Server accept it for temp and regular tables?
SQL SERVER – Puzzle – Solution – Why Does UNION ALL Work but UNION Produces Error?
Here is the answer to my puzzle: why does UNION ALL work but UNION produces an error with a TEXT column? It comes down to how UNION removes duplicates.
SQL SERVER – Puzzle – Why Does UNION ALL Work but UNION Produces Error?
A puzzle with TEXT columns: UNION ALL works fine, but UNION produces error. Can you tell why? The hint is in how UNION removes duplicates.
SQL SERVER – Puzzle – Brain Teaser – Changing Data Type is Changing the Default Value
Changing the Default Value is the question behind this data-type puzzle. I keep the expression, data type and nullability separate.
Adding Two Dates in SQL Server: Why the Year Is 2126
Adding two dates in SQL Server does not raise an error. It returns a date in the year 2126. This puzzle explains how datetime counts days from 1900, why the plus sign accepts a second date, and what to write instead.
SQL SERVER – Puzzle – Shortest Code to Produce the Number 1000000000 (One Billion)
This shortest code puzzle asks for 1000000000 without writing that literal or using arithmetic operators. The earlier zero puzzle brought roughly 700 valid answers.





