Using SSIS Trash Destination and Dummy Data Source

Introduction

In this article, you will learn Using SSIS Trash Destination and Dummy Data Source (FREE). You can write data into the file using Trash Destination, You can use Trash Destination to write data into a raw file from any source. We will use FREE Dummy Data Source to generate random data for testing purpose. Trash Destination can be used to terminate your dataflow pipeline without doing any expensive processing on incoming data. This component is very useful during testing where you want to focus on the source and transforms but don’t really care about the destination.

 

Prerequisites

Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:

  1. SSIS designer installed. Sometimes it is referred to as BIDS or SSDT (download it from Microsoft site).
  2. Basic knowledge of SSIS package development using Microsoft SQL Server Integration Services.
  3. Make sure ZappySys SSIS PowerPack is installed (download it).

Components mention in this article

Getting Started

SSIS ZS Trash Destination and Dummy Data Source are free. If you check save Data to file then by default all input columns are logged to file. If you wish to log the selected input column then use Advanced Editor. This component does not support an error output. Any bad random value ill cause error or Truncation (e.g. If your sample value is 5 characters long but output column length is set to 3 chars). If you have error output attached with RedirectRow option on error, Truncation then you can capture bad rows along with an exact reason of error.

Write data into the file using Trash Destination

Overview

In this tutorial, you will learn how to Using SSIS Trash Destination and Dummy Data Source.  Let’s use ZS DummyData Source to write data into ZS Trash Destination. Here you can select our, any of suitable Source Adapter.

Method 1 – Using ZS DummyData Source

  1. Open Visual Studio and Create New SSIS Package Project.
  2. Now, Drag and Drop SSIS Data Flow Task from SSIS Toolbox.
    Drag and Drop SSIS Data Flow Task from SSIS Toolbox

    Drag and Drop SSIS Data Flow Task from SSIS Toolbox

  3. Double click on the Data Flow task to see the Data Flow designer surface.
  4. From the SSIS toolbox drag and drop ZS DummyData Source on the data flow designer surface.
    Drag and Drop ZS DummyData Source

    Drag and Drop ZS DummyData Source

  5. Double click DummyData Source and select Customer profile from Template dropdown.
  6. Once you change Template you will notice that a lot of columns automatically added. Notice how sample values are set for many columns along with their value delimiter. You may use many inbuilt placeholders in your sample values such as ({NULL} for a null value, {TAB} for the tab character, {CRLF} for new line).
  7. Change [How many rows] setting to 5000.
    SSIS DummyData Source - Configure

    SSIS DummyData Source – Configure

  8. Click OK to save settings.
  9. We can use DummyData Source like this, click here.
  10. Here, you can insert data into SQL Server Table, Check Here.
  11. Now, Just Drag and Drop Our Free ZS Trash Destination on the data flow designer surface from SSIS Toolbox.
    SSIS Trash Destination - Drag and Drop

    SSIS Trash Destination – Drag and Drop

  12. Now single click on ZS DummyData Source once you see the blue arrow from the source … connect it to ZS Trash Destination.
  13. Double click on ZS Trash Destination to configure it.
    SSIS Trash Destination - Configure

    SSIS Trash Destination – Configure

  14. Click OK to save configure setting UI.
  15. Right-click on the path and Add Data Viewer.
  16. Execute the package and verify source data in the data viewer.
    Execute Package and Verify Data Source

    Execute Package and Verify Data Source

Method 2 – Using OLE DB Source

Let’s use ZS OLE DB Source to write data into ZS Trash Destination.

  1. Open Visual Studio and Create New SSIS Package Project.
  2. Now, Drag and Drop SSIS Data Flow Task from SSIS Toolbox.
    Drag and Drop SSIS Data Flow Task from SSIS Toolbox

    Drag and Drop SSIS Data Flow Task from SSIS Toolbox

  3. We are going through SQL Server Database, need OLE DB Connection for Data Source.

How to create OLE DB Connection.

  1. Let’s, Right-click on Connection Managers Panel to Create OLEDB Connection, so you can use Source and Context Menu will appear, Select New OLEDB Connection from the Context Menu.
    Create OLE DB Connection

    Create OLE DB Connection

  2. Now, click on New button for create Connection.
    Create New OLE DB Connection

    Create New OLE DB Connection

  3. In the Connection Manager, just follow the steps in the following image we have created.
    OLE DB Connection Configure

    OLE DB Connection Configure

  4. Click on OK button to save connection configure setting UI.

How to write into Trash Destination from OLE DB Source

  1. Drag and Drop OLE DB Source from SSIS toolbox.
    OLE DB Source - Drag and Drop

    OLE DB Source – Drag and Drop

  2. Double click on OLE DB Source for configure it.
  3. In the Connection Manager, just follow the steps in the following image we have created.
    OLE DB Source - Configure

    OLE DB Source – Configure

  4. Click on OK button to save OLE DB Source Editor setting UI.
  5. Now, Just Drag and Drop Our Free ZS Trash Destination on the data flow designer surface from SSIS Toolbox.
    SSIS ZS Trash Destination - Drag and Drop

    SSIS ZS Trash Destination – Drag and Drop

  6. Now, single click on OLE DB Source once you see the blue arrow from the source … connect it to ZS Trash Destination.
  7. Double click on ZS Trash Destination to configure it.
    SSIS ZS Trash Destination - Configure

    SSIS ZS Trash Destination – Configure

  8. Click OK to save configure setting UI.
  9. Right-click on the path and Add data viewer.
  10. Execute the package and verify source data in the data viewer.
    Execute Package and Verify Data

    Execute Package and Verify Data

Conclusion

In this blog, we learned how to write data into a raw file and read data in SSIS. We used the Trash Destination for write data and Dummy Data Source to read data. You can download SSIS PowerPack from here to try many other scenarios not discussed in this blog. SSIS PowerPack is a collection of 70+ high performance, just drag and drop connector/task for SSIS(i.e. Microsoft SQL Server Integration Service). After you install SSIS PowerPack you will see many new Custom Tasks and Components in your Visual Studio SSIS Toolbox.

References

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

Posted in SSIS Components, SSIS Trash Destination and tagged , , , , , .