Execute SQL query against Amazon Redshift in SSIS

Introduction

ZappySys provide high-performance drag and drop connectors for Amazon Redshift Integration. In previous post we saw how to read / write Amazon Redshift data in SSIS. Now in this post, you will see how to Execute SQL query against Amazon Redshift in SSIS using ZS Amazon Redshift ExecuteSQL Task. SSIS Redshift Execute SQL Task can be used to send any SQL queries to Redshift Cluster without needing ODBC driver. You can Issue various SQL commands such as DROP, COPY, UNLOAD, CREATE, etc very easily. Load query at runtime from variable, file or Direct value. You can also issue SQL query to fetch resultset to store in variable and then loop records using this technique.

 

Prerequisite

  1. First, you will need to have SSIS installed
  2. Secondly, make sure to have SSDT
  3. Thirdly, You have obtained Amazon Redshift Credential.
  4. Finally, do not forget to install ZappySys SSIS PowerPack.

Component Mention in this article

What is Amazon Redshift

Before we talk Execute SQL query against Amazon Redshift in SSIS lets talk what is Amazon Redshift (or sometimes referred to as AWS Redshift). Amazon Redshift is a Cloud-based Data warehouse service. This type of system also referred to as MPP (Massively Parallel Processing). Amazon Redshift uses a highly modified version of PostGrey SQL Engine behind the scene. Amazon Redshift provides the advantage of Scale as you go, at a very low cost compared to onsite dedicated hardware/software approach. In this article, we will try to learn how to Execute SQL query against Amazon Redshift in SSIS.

Getting Started

In order to start, we will show several examples. ZappySys includes an Amazon Redshift ExecuteSQL Task, that will help you how to Create and Drop table by Execute SQL query against Amazon Redshift in SSIS. You can connect to your Amazon Redshift Account by entering credentials.

Execute SQL query against Amazon Redshift in SSIS

Let’s start with an example, In this tutorial, we will learn how to CREATE and DROP table using SQL query against Amazon Redshift ExecuteSQL server using ZS Amazon Redshift ExecuteSQL Task.

  1. In order to connect to the Amazon Redshift Database from SSIS, you will need credentials. Ask your SysAdmin or responsible person to provide that you.
  2. Once you finished the first step, Open Visual Studio and Create New SSIS Package Project.
  3. In your SSIS toolbox, you should see many new Icons starting with “ZS” (i.e. ZappySys). If you don’t see them then check this.
  4. Here, In Visual Studio, drag and drop the Amazon Redshift ExecuteSQL Task in the design surface.
    SSIS ZS Amazon Redshift ExecuteSQL Task - Drag and Drop

    SSIS ZS Amazon Redshift ExecuteSQL Task – Drag and Drop

  5. Now we need Amazon Redshift Connection. Click here to Create Amazon Redshift Connection.
  6. Double click on Amazon Redshift ExecuteSQL Task to configure it.
  7. Select connection we have created before, set Sql Source Type to DirectValue, Result Type to FullResultSet and select object Datatype Variable and Use following SQL Query for Amazon Redshift.
    Execute SQL query against Amazon Redshift in SSIS

    SSIS Amazon Redshift ExecuteSQL Task – Configure

  8. Click on OK button to save configure setting UI.
  9. That’s all, right-click on the task and run or Execute. This should create a new table in Redshift.
    SSIS ZS Amazon Redshift ExecuteSQL Task - Run or Execute

    Run or Execute SSIS ZS ExecuteSQL Task Package

Conclusion

After all, In this blog, we learned how to Execute SQL query against Amazon Redshift in SSIS using ZS Amazon Redshift ExecuteSQL Task. You can download SSIS PowerPack here to try many other scenarios not discussed in this blog along with 70+ other components.

References

Finally, you can use the following links for more information:

Posted in SSIS Amazon Redshift ExecuteSQL Task and tagged , , , , , , , .