Category: Beginner

T-SQL: CASE Statement

This is a companion piece to the MidnightDBA video T-SQL: CASE Statement. In short, a CASE statement is a simplified set of IF statements. Instead of using several IF statements, you can have a single statement that evaluates several criteria against a piece of data.  Simple CASE Let’s take a simple example. We want to […]

RTFM365, Week 1

Big lessons learned this week: 1, its’ always worthwhile to go back and reread the basics. 2, sys.sp_trace_create option 4 doesn’t stop the server side trace, it stops SQL Server itself. Be warned. Boilerplate: For the next year (-10 days now), I will read from SQL Server Books Online a little every day, and blog about […]

Tip: Schema Qualify Objects in SPs

“Eat your broccoli.” “Wear your gloves.” “Schema qualify your objects.” Your Mom wasn’t kidding, and she always gave the best advice. We’ve already seen how it would have paid off for us to end all T-SQL statements with a semicolon, even though it’s not currently required – after all, don’t CTEs and MERGE statements have […]