SSIS Sort Transformation
[[articles:SQL Server Integration Services (SSIS)|Integration Services]] uses transformations to manipulate data during an [[articles:Extract Transform Load (ETL)|ETL]] dataflow. Transformations can be used in [[articles:SSIS Dataflow Task|Data Flow Tasks]], between data source and destination components, or other transformations.
The Sort transformation basically has only one task: to put the incoming rows in a specified order to the output. The Sort has only one input and one output.
The Sort transformation can be used for removing duplicates from a dataset as well: all rows which have duplicate sort values will be omitted from the output, if you select the "Remove rows with duplicate sort values" option in the editor of the transformation.
Here is an example screenshot of the Sort Transformation Editor:
In the example above, the output will not contain the ID column (only the Date and Label columns), and it will be ordered by the values of the Date column. Every row will be included, even if duplicates are found in the Date column.
The Sort transformation is a blocking one: since all input rows are needed to get the rows in the desired order, the flow of data will stop until this transformation ends the calculation. This applies to deduplication as well, since at least one column must be selected for sorting.
Sort is mostly used before the [[articles:SSIS Merge Join Transformation|Merge Join transformation]] (which accepts two sorted inputs only).
For more detailed information on this transformation, please refer to this MSDN article.
For the complete list of SSIS transformations, check [[articles:SSIS: List of Transformations|this Wiki article]].