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.
SQL SERVER – Select Unique Data From a Column Exist in Two Different Table
A reader wanted to Select Unique Data from a column in two tables, keeping only values found in just one of them. Here is the query that does it.
SQL SERVER – Puzzle – Write a Shortest Code to Produce Zero
This Zero puzzle asks for the shortest SQL Server code within three restrictions. I want the exact code and character count.
SQL SERVER – Puzzle – Incorrect Results with Decimal
A new puzzle: a simple table with price and discount returns Incorrect Results with DECIMAL. Can you work out why without running the code in SSMS?
SQL SERVER – Why We have Audit Trace in DATA Folder? What are These Files?
The DATA drive filled up with thousands of audittrace .trc files. Here is why SQL Server writes audit trace files there and how to stop them.
SQL SERVER – Puzzle – Why does sp_spaceused Show No Values?
Why does sp_spaceused show no values for a table that clearly has rows? It stumped me for 10 minutes. Here is the puzzle, try it before reading on.






