1

I am new to SSIS and I am relying on a book, so this should be an easy question to answer.

I want to import data from all of the text files within a directory. So I create a Foreach container.

The first thing I want to do within the loop is execute a SQL task to drop and create the landing table.

Then I want to load the data into the landing table from the selected text file using a Data Flow task.

Then I want to execute a SQL Task to load the SQL tables from the Landing table and do some calculations.

The problem is that within a Foreach loop, I cannot connect up a SQL Task to a Data Flow task. The message I get is

Cannot create connector. Cannot connect the executables from different containers.

So how do I do this?

6 Answers 6

2

How about a screen shot? I've used these 2 components in a loop container before with no problem, my guess is the GUI is a little deceptive here.

Sign up to request clarification or add additional context in comments.

3 Comments

I know it seems rather lame awarding you the correct answer ... but when I logged into the system the next day I had no problems. So as you say, it must be the GUI! How very odd!
Np, thanks for the answer. I've had the same type of thing happen, the interface is just buggy sometimes. You on 2005 or 2008?
I am on 2005. Anyone using 2005, beware!
2

I know this is an old thread. I wanted to add to it though in case it is helpful to anybody.

In my case, I had the foreach loop container with some FTP Tasks and Script Tasks in it and I still need to add more within this foreach loop. I renamed the foreach loop and then added a new Script Task at the bottom of the flow of the foreach loop container. When I tried to connect the current FTP Task at the end of the flow of the foreach loop container to the new Script Task that I'd added at the bottom, I got the error about "Cannot create connector. Cannot connect the executables from different containers."

So I dragged the current FTP Tasks and Script Tasks outside of the newly renamed foreach loop container (or I suspect I could have cut them and pasted them outside the foreach loop container). I then dragged them all back into the newly renamed foreach loop container. I then connected them all again successfully without getting this error.

So it seems that once you rename a foreach loop container WITHOUT being done completely, when you add a new Task icon to the bottom of the flow of the newly renamed foreach loop container you might or will get the error about not being able to connect from different containers (since I guess the newly renamed foreach loop container is considered to be "different" than the old name of the very same foreach loop container.

Comments

1

I've had a similar problem, where is looked as though both the components were in the for loop. Whereas (similar to rageit's comment) one of the sub-compnents were actually on-top rather than within the foreach loop.

The quick fix was to cut the component, select the foreach loop and paste it in.

Comments

0

It looks like you are trying to connect a Sql Task within a foreach loop to a DataFlow task that is not in the loop. If that is what you are intending, you need to take the connection from the ForEach loop and connect it to the DataFlow. If, however, you want both the SQLTask and the Dataflow to run within the ForEachLoop, you need to put the DataFlow into the ForEach loop and then you will be able to connect the SQLTask to the DataFlow.

3 Comments

The intention is that they are both in the loop. The way it looks like they are is that I have dragged them both within the Foreach container in the diagram.
The error "Cannot connect executables from different containers" seems to show that the tasks are not in the same container. Highlight your dataflow task, right click it and select "Add Precedence Constraint" If the SQL Task is not in the list for 'From' then the data flow is not in the same container as the SQL task.
Same thing happened to me. Apparently a control flow item was not contained in the for each loop but it was on top of the for each container. VS2008.
0

None was my case. I just moved it from different container to a new container. I had to recreate the task. There is no property to show you what container is holding the task. Definitely GUI bug. I'm using BI 2008

Comments

0

Solution that solved my problem is cut the component and paste it back. If there is a heirarchy of tasks cut all tasks one by one to delete their connections and paste them back and then connect from the top.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.