Incremental Load in SSIS Made Easy

25 January 2018
KingswaySoft Team

Incremental Loads in SSIS are often used to keep data between two systems in sync with one another. They are used in cases when source data is being loaded into the destination on a repeating basis, such as every night or throughout the day.

Typical incremental load processes within SSIS involve lookups to find changes and staging tables in order to update a database due to limitations with OLE DB/ADO.NET Destination components. This limits the data we are able to work with and can take more time to develop.

At KingswaySoft, many of our SSIS components include features that enable developers to easily develop performant incremental load solutions within just a couple of steps. In this post we will be looking at how this can be achieved using our Premium ADO.NET components within a single source to destination data flow without the need for any lookups or staging tables.

Traditional SSIS Incremental Load vs Upsert method

ssis incremental load old data flow

ssis incremental load new data flow

Simple data flow using SSIS Productivity Pack and Upsert without lookups, staging tables, or coding.

Our Premium ADO.NET components offer greater metadata handling and flexibility when working with relational databases. The destination component also includes the ability to Insert, Update, Delete, Upsert, or to insert a custom command to write data to a database.

ssis incremental load write actions

In this post we will be using Upsert to assist with incremental load in SSIS. Upsert is a combination of Update and Insert. When writing to your target system with the Upsert action, the component will check if a record already exists in the system based on the matching field you specified. If it finds a match, it will update that record, if it does not, it will create a new record.

What this means for your incremental load development is less time developing your package and greater performance. You no longer need to perform a lookup and conditional split before the destination, you have the option of going directly from the source to the destination and the Upsert action is completely configured in 2 simple clicks.

Let’s take a closer look at the entire process for easy incremental loads in SSIS.

First we will create two connection managers (source & destination) using the out of box ADO.NET connection manager and selecting the database we wish to retrieve from.

Next, we will create a data flow task and enter into it. For this example we will drag out the Premium ADO.NET Source to pull from our source system though any other source you need to work with would also work.

From here we will configure our component, connecting to the database and selecting the table we wish to read from. Notice a SQL Query is already generated for us based on the columns stored in that table. The table we are using in this example is tracking changes using the field labeled ModifiedOn, this is a datetime field the database is configured to update when a row is added or modified. We can use this field to filter out any data that has not been updated since the last pull which is being stored in an SSIS variable. This will greatly help with performance when we write to our target system later on.

ssis incremental load retrieve modified data

Now that we have our source configured we can connect it directly to the Premium ADO.NET Destination component.

In configuring our destination component we will select the 'Target Database' connection manager we established earlier. Next we will select Upsert as our write action. As mentioned this action a combination of Insert and Update which is what is allowing us to skip the lookup & conditional split steps traditionally used in incremental data loads in SSIS. From there we can select the appropriate table or create a new one. We will also select 'Use Bulk' to speed up performance (note as of the writing of this blog post, this option is only supported when working with SQL or Oracle databases).

ssis incremental load upsert

Over on the Columns Page, you will notice any fields from the source with the same name as the destination have already been mapped. We can then use the drop-downs to complete any of the additional mappings. Next we need to select our key field. The key field is what the component will use to match records to check if the record exists in the target system, it will need to find an exact match. You can select 1 or multiple fields for this case. In our example we have specified the ContactID to be our key field.

ssis incremental load upsert key field

We can then complete my component configuration and execute our task.

The majority of our other destination components also support Upset capability meaning this process can be replicated for performing incremental loads across many different applications. Some components may also include additional features to further enhance performance with incremental loads. Likewise, many of our other source components also support some form of filtering to assist with lowering the number of records we are working with to only those that have been changed.

This is a very simple and straight forward incremental load using SSIS and assumes records are not being removed from either database. For handling deleted records and other more advanced requirements there are many other tricks you can use using the SSIS Productivity Pack, we will cover some of them our next blog post.

This solution requires SSIS Productivity Pack, you can click here to download the free developer's license to get started.

Archive

November 2024 3 October 2024 1 September 2024 1 August 2024 2 July 2024 1 June 2024 1 May 2024 1 April 2024 2 March 2024 2 February 2024 2 January 2024 2 December 2023 1 November 2023 1 October 2023 2 August 2023 1 July 2023 2 June 2023 1 May 2023 2 April 2023 1 March 2023 1 February 2023 1 January 2023 2 December 2022 1 November 2022 2 October 2022 2 September 2022 2 August 2022 2 July 2022 3 June 2022 2 May 2022 2 April 2022 3 March 2022 2 February 2022 1 January 2022 2 December 2021 1 October 2021 1 September 2021 2 August 2021 2 July 2021 2 June 2021 1 May 2021 1 April 2021 2 March 2021 2 February 2021 2 January 2021 2 December 2020 2 November 2020 4 October 2020 1 September 2020 3 August 2020 2 July 2020 1 June 2020 2 May 2020 1 April 2020 1 March 2020 1 February 2020 1 January 2020 1 December 2019 1 November 2019 1 October 2019 1 May 2019 1 February 2019 1 December 2018 2 November 2018 1 October 2018 4 September 2018 1 August 2018 1 July 2018 1 June 2018 3 April 2018 3 March 2018 3 February 2018 3 January 2018 2 December 2017 1 April 2017 1 March 2017 7 December 2016 1 November 2016 2 October 2016 1 September 2016 4 August 2016 1 June 2016 1 May 2016 3 April 2016 1 August 2015 1 April 2015 10 August 2014 1 July 2014 1 June 2014 2 May 2014 2 February 2014 1 January 2014 2 October 2013 1 September 2013 2 August 2013 2 June 2013 5 May 2013 2 March 2013 1 February 2013 1 January 2013 1 December 2012 2 November 2012 2 September 2012 2 July 2012 1 May 2012 3 April 2012 2 March 2012 2 January 2012 1

Tags