Sunday 23 September 2012

AVOIDING SORT TRANSFORMATION IN SSIS


If we are using “Merge or Merge Join” transformation, we should pass sorted datasets as a source to the transformation. If we use sort transformation performance will degrade.
            We can avoid the sort transformation by using source “Advance editor” option, if source is excel or OLEDB.

Example:
  • Edit the source (excel or OLEDB source) and change the “Data access mode:” to “SQL Command”.

  • Writ the select statement for source table with order by (on required fields).



  • Click “OK”.
  • Right click on the source and select “Show Advanced Editor” option.

  • “Advanced Editor for OLEDB Source” window will open. Click on “Input and Output Properties” option.

  • In the “Inputs and Outputs:” section, select the “OLEDB Source Output”.

  • Right side of the window “Common Properties” will enable.

  • Set “IsSorted” property as true.

  • In “Inputs and outputs:” section expand the “OLEDB Source Output” list.

  • Expand the “Output Columns” list. And select ID column because we need to sort the source data based on ID column.

  • ID column “common Properties” list set the “SortKeyPosition” as “1”.

  • Click “OK” button to complete the sorting.


















No comments:

Post a Comment