SQL Screw-ups: Outer Join Filters

This is a continuation of the SQL Screw-ups series that stemmed from my Nashville .NET User Group talk on 03/14/2019. Slides and setup details are on the first post in the series.

Think about the last time you needed apply additional filtering to a query based on information from some other table. You probably JOINed the additional table or added an EXISTS predicate in the WHERE clause. Let’s discuss ways you might’ve screwed it up. Continue reading “SQL Screw-ups: Outer Join Filters”

SQL Screw-ups: The Wonders of NULL

This is a continuation of the SQL Screw-ups series that stemmed from my Nashville .NET User Group talk on 03/14/2019. Slides and setup details are on the first post in the series.

The definition of null is unknown according to Microsoft documentation. That is, null represents an unknown value. It took an embarrassingly long time for me to catch a common mistake I was sometimes making regarding null. Here’s the scoop.

Continue reading “SQL Screw-ups: The Wonders of NULL”

SQL Screw-ups: Stored Procedure Misuse

This is a continuation of the SQL Screw-ups series that stemmed from my Nashville .NET User Group talk on 03/14/2019. Slides and setup details are on the first post in the series.

Imagine you’re starting a brand new project. You can make design decisions to mitigate all the issues you encountered in the legacy app you’ve been stuck working on. What a great opportunity! While the new project must integrate with the legacy app, none of the code has to match the legacy style.

Continue reading “SQL Screw-ups: Stored Procedure Misuse”

SQL Screw-ups: Scalar-Valued Functions

This is a continuation of the SQL Screw-ups series that stemmed from my Nashville .NET User Group talk on 03/14/2019. Slides and setup details are on the first post in the series.

Imagine you need to calculate the extended price for records in the Sales.SalesOrderDetail table. A simple way to get the extended price for an order line item is to multiple the order quantity by the unit price.

Continue reading “SQL Screw-ups: Scalar-Valued Functions”

SQL Screw-ups

I talked about SQL Screw-ups at the 03/14/2019 Nashville .NET User Group meeting. I really appreciate everyone who attended, and I hope you got something out of it. I’ll do a deep dive into each topic from the talk as a series of detailed posts so you can work through each screw-up on your own. I’ll also include feedback and tips I received during and after the talk.

Side note about the talk: It was a very rewarding experience and honestly an honor to speak at the user group meeting. The user group leadership does a great job, the sponsor is amazing, and the attendees are the absolute best. I learned how much I enjoy speaking to an engaged audience, and I learned a few things about SQL from the attendees, too!

This was a code demo talk, so the slides alone are not very beneficial. This post includes the the slides and setup details. I’ll post one deep dive per week, so subscribe to email updates if you are looking for more information on one of the screw-ups I talked about (you can always unsubscribe once you’ve been notified of the post).

Continue reading “SQL Screw-ups”