Upserts

Up to this point in our design patterns sessions we’ve concentrated on removing duplicates from our troubled table.  Now, let’s look into preventing those duplicates from being inserted in the first place.  If you haven’t heard the phrase upsert before, it’s the idea of doing an INSERT and UPDATE in the same statement, that way… Continue reading Upserts

De-duping by CTE

Ok, today we wrap up our design patterns for removing duplicates from tables by turning to common table expressions (CTE’s). When I start talking CTE’s some people begin to cringe in fear. I’ll admit, I still have to refer to a reference when doing something I haven’t done before with a CTE, which is pretty… Continue reading De-duping by CTE

De-duping by Self join

Let’s continue the series on getting rid of duplicate data.  Today we’re going to use self joins to get rid of them.  A self join is a join from a table back to itself.  It might seem weird to do that, but by the end of this article you’ll see how it’s useful.  I use… Continue reading De-duping by Self join