Sunday 17 April 2016

UnPivot transformation in SSIS

UnPivot is a mechanism where we converting the column into row.


Let’s see the example.

Here we have a Pivot table in this table Qtrs are columns. We are converting this column to row as given in the above picture.

Let’s learn how to use UnPivot transformation in SSIS

Open SSDT.
Take Data Flow task.
  
Double click on the Data Flow Task.
In Data Flow pane taking Sources as OLEDB source
  
Creating the connection
   
In Pivot table we have store the data
  
Map the column.
  
Click ok.
Now I am taking UnPivot Transformation
  
Double click on the UnPivot transformation.
  

1. Pass Through

Select the name which you want to carrier. In this example I checked the CompanyID for farther we use these values.

2.

Select the column name which we want to convert Column to Row.

3a.

Name of the Column (Input)

3b.

Name of the Row value (corresponding)

4.

Values of this column name.

5.

Name of these Columns.
See the below. You will get the clear idea about it.
  

6.

Click ok button.
Now I am taking OLEDB destination to store the values.
  
Creating the connection
  
Mapping the columns
  
Click ok.
Package is completed.
  
Now it is ready to run.
  
Oh!!! Package executed successfully.
Let’s see the result in data base
  

Getting expected result.

1 comment:

If you have any doubt, please let me know.

Popular Posts