SHARE
Facebook X Pinterest WhatsApp

The Adventures of SQL Sam, SQL Detective!

Written By
thumbnail
Steve Hontz
Steve Hontz
Aug 24, 1999

About SQL Sam…

When I was a boy, I enjoyed reading the Encyclopedia Brown, Boy Detective
series by Donald J. Sobol. Encyclopedia Brown was a kid my age who had read the entire encyclopedia,
and, using his knowledge and powers of observation, solved neighborhood mysteries that no one
else could solve.

Being a wanna-be writer at heart, and having a love of solving SQL Server problems, I decided to combine some of my
real-life SQL Server experiences with the fictional character of SQL Sam, SQL Detective.
Each case presented here is based on actual events, with the names and details changed to protect the, ummm, less-enlightened.
(And, by the way, the examples shown here have been simplified for presentation and don’t necessarily represent runnable code. In
other words, don’t try this at home…)

Enough details are presented in each case so you can try to solve the mystery yourself. If you’d like some more hints, click
on the Turn On Clues link at the top of the page.
The solution then shows
how SQL Sam solved the mystery.

If you’re curious about the story behind the stories, and want to know the
secret "jokes" I planted in each story, go to
Behind the SQL: The Making of SQL Sam.

And now, without further ado, I present…

The SQL Sam Case Files


Steve Hontz is President of The Bit
Corner, Inc.
, a Phoenix-based consulting firm
specializing in Windows NT, C++, and SQL Server
development. You can reach him at
steve@bitcorner.com.

Recommended for you...

Best Online Courses to Learn SQL
Ronnie Payne
Sep 23, 2022
Best Courses for Database Administrators
Ronnie Payne
Jul 22, 2022
Tip 74 – Changing Cost Threshold for Parallelism
Gregory Larsen
Feb 24, 2021
How Many Databases Can You Name?
Brad Jones
May 11, 2020
Database Journal Logo

DatabaseJournal.com publishes relevant, up-to-date and pragmatic articles on the use of database hardware and management tools and serves as a forum for professional knowledge about proprietary, open source and cloud-based databases--foundational technology for all IT systems. We publish insightful articles about new products, best practices and trends; readers help each other out on various database questions and problems. Database management systems (DBMS) and database security processes are also key areas of focus at DatabaseJournal.com.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.