From the course: SQL Server Integration Services

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Prevent duplicate records

Prevent duplicate records

- [Instructor] Before we call this data flow complete, we need to think through what happens if you run it multiple times. The destination component is simply writing records to an existing table in the Kinetico database. In this regard, it's acting like an insert into query, where records are simply being added to what's already there. If you run this data flow multiple times, for instance, by pressing the start button, then you're going to wind up with duplicate records in the tables. Let's take a look back inside of management studio and I'm going to take a look inside of the SampledCustomers table again. This time I'll select top 1000 rows and you'll see that it's now returning 219 rows, where previously we had 108. At this point, we have two copies of every single record in this table. That's probably not the ideal situation that you were looking for. So, we need to go back into Visual Studio and make a change to our work flow. One way that we can deal with this is by truncating…

Contents