Reputation: 12575
I use SQL Server 2016
and I have a very busy DataFlow task
. In my DataFlow task
, I use Multicast component
for some reason. After creating a new Flow in my DataFlow
, I need to delete some of the columns in the new flow because they are useless.
Just for more information, I need to do that because I have more than 200 columns in my flow and I need less than 10 of those columns.
How can I delete the columns in DataFlow Task
in SSIS?
Upvotes: 4
Views: 12432
Reputation: 4477
You can add an extra component of some sort. However, this will never reduce complexity or improve performance. Just thinking about it, logically, you are adding an additional interface that needs to be maintained. Performance-wise, anything that will eliminate columns means copying one set of rows from one buffer to a whole other buffer. This is called an asynchronous transformation, and it is better described here and here. You can imagine that copying rows is less efficient than updating them in place.
Here are some recommendations for reducing complexity, which will, in turn, improve performance:
These guidelines will get you headed in the general direction, but do post more questions for tuning specific performance problems.
Upvotes: 1
Reputation: 37358
First of all, i don't think that what you are asking will give a better performance because the data is loaded from source then multiplied when using Multicast
Then The component that will reduce the column number
...
You can do this multiple way:
If you can create another DataFlow Task
with a Reduced columns source (ex: OLEDB command with specific columns) it is better
You can add Script component
with an Asynchronous Output (like shown in the image below) and add the specifid columns to the output, map them using a Vb.net or C# script, something like this:
Output0Buffer.AddRow()
Output0Budder.OutColumn = Row.inColumn
UNION ALL
component and select the columns you needSide Note: It is good to test each scenario performance and choose the better
Upvotes: 1
Reputation: 1717
I believe that you can pass just one data flow path to a UNION ALL
task to remove columns from that single data flow.
Take the single data flow path that you would like to remove columns from and pass it to a Union All
task. Then open up the Union All
task right click on the column(s) you would like to remove from that path and select delete.
Usually I think the source of the data should be altered to not send the unwanted columns out, but your case is special. With one path out of the multicast needing all of the columns from the source, while one path does not.
Upvotes: 3