Search code examples
ssisetlssis-2012ssis-2008

Load the same file using different data flow task with different script component


I have encountered a weird situation now.

Basically I have two data flow tasks in my SSIS package, these two tasks are loading the data to the same staging table. Each one is using the script component as the data source, and using the StreamReader on different two files.

If I enable two tasks at the same time, the 2nd data flow task loads the same data as the first one. But if I disable the 1st one and just leave the 2nd one enabled, it loads the correct file as expected.

I am not very sure what did I do wrong since all the StreamReader are defined on files with different names, the only common part is loading to the same destination.

And these two tasks are not in parallel, they are being constrained in sequence.

Any suggestion or advice? Thanks in advance.


Solution

  • Thanks for the comments, actually I found why they are trying to load the same data when two connections are open at the same time. It is because I copied the 1st script component to the 2nd one, which sharing the same task ID within the container, I tested multiple times, it turned out to be if the task ID are the same, the 2nd one will do what the 1st does, basically it is just the replica task as the 1st one even the codes are different.

    Please correct me if my findings are wrong, but it seems it is what it is during my past tests.