I have an SSIS package (2008 R2) that I'm working on and I find myself duplicating the same OLE DB commands repeatedly and whenever there is a change its a nightmare to go back through and update all the duplicate OLE DB command tasks.

Is there a way to execute a single OLE DB command for multiple paths?

enter image description here

  • If you could point both paths to the same OLE DB Command, you would probably have to split them again in the next step anyway... Possible but not recommended :) – Roi Gavish Jun 2 '13 at 8:27

I don't think your reason justifies using this solution (sisyphean labor is part of a programmer's life...)
It is not efficient and i would not recommend it in your situation.
If, however, your aim was to perform one logical operation for several streams, and your streams have similiar data structure... , there is a way to do it.

Your best option is to use the Union All Data Flow Transformation component.
You can map the overlapping input columns to the same output columns, or map them to different columns for easier split in the next step if necessary.
You can also add a derived column for each of the inputs befor the union, which will hold an input identifier, again for the split to come.

Using Union All without adding columns

There is another way to do it, using a Script Component (one for each path) instead of the OLE DB Command and passing a variable to it.
The variable holds the command to execute, and is initialized in the control flow once.
I find it too cumbersome, maybe because I'm just a DBA (not programmer) and lack scripting knowledge...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.