SQL Insights

CASE Is an Expression

Want to get tons of comments about a SQL Server post?

Refer to CASE as a statement.

It’s easy to mistakenly call a CASE expression a CASE statement, even though it's technically an expression within a statement. If you want to kindly correct someone, consider sending a direct message if that’s an option. It’s like telling a coworker they have lettuce stuck in their teeth after lunch.

We’ve all made mistakes and still do. It doesn't diminish the value you bring if you can’t remember which SQL Server version or edition supports a particular feature. That’s why we have books, notes, and this new thing called the internet, so we don’t have to remember all this information, and it is just information. As David Alan said, “Your mind is for having ideas, not holding them.”

For the longest time, I referred to GO as a statement until someone pointed out in a comment on a course I taught that it's a command. After reviewing the Microsoft document, I found myself thinking, "Well, Duh."

Remember that we are all still learning, one statement or expression at a time.