Merge / Upsert data in Amazon Redshift using SSIS

Introduction

Access-to-AmazonRedshiftIn our previous blog we saw how update / insert data into SQL Server using SSIS Upsert Destination. In this post we will look at specific example on Data migration from Access to Amazon Redshift using SSIS Upsert Destination (Insert, Update, Delete), along with few other topics such as how to create table using Upsert Destination. how to read all Customers data from Ms Access Table and Merge it in the Amazon Redshift.

We will go through the steps to read data from Access and Load into Amazon Redshift.

In nutshell, this post will focus on how to read access table data in SSIS.

So let’s get started.

Requirements

  1. First, you will need to have SSIS installed
  2. Secondly, make sure to have SSDT
  3. Thirdly, do not forget to install ZappySys SSIS PowerPack
  4. Finally, Make sure that Microsoft Access installed.

How to Read MS Access table data and migrate that data in Amazon Redshift table.

Let´s start with an example. In this article we will see Data migration from Access to Amazon Redshift.

  1. First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit.
    Drag and Drop SSIS Data Flow Task from SSIS Toolbox

    Drag and Drop : SSIS Data Flow Task from SSIS Toolbox

  2. Furthermore, drag and drop the OLE DB Source.
    OLE DB Source - Drag and Drop

    OLE DB Source – Drag and Drop

  3. Double click on OLE DB Source for configure it and click on New Connection and configure connection as below to connect access database and click on OK.
    OLE DB : Access Connection

    OLE DB : Access Connection

  4. Now in OLE DB Source Select the mode as Table or View and select Preview to view the access table data.
    OLE DB Source Preview

    OLE DB Source Preview

  5. Now drag and drop Upsert Destination (Insert, Update, Delete) and create connection with Amazon Redshift Database.
    Upsert Destination : Amazon Redshift Connection

    Upsert Destination : Amazon Redshift Connection

  6. Now select Action as Sync and check all the checkboxes Insert, Update and Delete from target if not found in source. Select the table and Map all the columns and select the Key field(s) and click on OK.
    Upsert Destination Configuration

    Upsert Destination Configuration

  7. That’s it we are ready to migrate MS access table data into Amazon Redshift Table. Execute the package and it will migrate the data.
    Upsert Destination (Insert, Update, Delete)

    Upsert Destination (Insert, Update, Delete)

Bulk Update data in Amazon Redshift

So in previous example we saw bulk update or insert (Upsert) in Redshift Table. Now let’s look at how to update data in target table if record exists.

Here is how you can perform bulk update in Amazon Redshift using Upsert Destination.

  1. Double click on Upsert Destination for configure it.
  2. Set Action Bulk Update => based on matching records on target. Select Connection and Target Table. Click on Map All to Mappings all columns and check on Only Primary Key columns.
    SSIS Bulk Update rows in SQL Table
  3. Thats all, Click on OK to save Upsert Destination settings UI.

Bulk Delete data in Amazon Redshift

Here is how you can bulk delete data in Amazon Redshift.

  1. Double click on Upsert Destination for configure it.
  2. Set Action Bulk Delete => based on matching records on target. Select Connection and Target Table. Click on Map All to Mappings all columns and check on Only Primary Key columns.
    SSIS Bulk delete rows in SQL Table
  3. Thats all, Click on OK to save Upsert Destination settings UI.

 

Conclusion

In this article, we show how to read MS Access table data and migrate the data in Amazon Redshift table using SSIS. We show how to do connect access MS Access using OLE DB Source. Also, we show how to write Sync Insert, Update and Delete in target if not found in Source Using ZS Upsert Destination. If you liked this article and you want to try, you can download the SSIS PowerPack from here (includes 70+ Components).

References

Posted in Redshift, SSIS Upsert Destination and tagged , , , , .