Naresh
Naresh

Reputation: 47

Does parallel execution in SSIS work correctly?

Can anyone say, " Are there any priorities within ddl and dml commands? "

Because, I came across a scenario where I have a ssis package where in which I have one dataflow task in control flow, whose work is to transfer data from flatfile source(filename: Table_A with 50 records) to OLEDB destination(Table_A). I have another task called Execute SQL Server command task in the same control flow pane which deletes whole data from the same table (Table_A).

After running this package for first time, I observed that both tasks runs parallely.

1st run: Both tasks executed successfully with green ticks. There was data in database (all 10 records). Data hasnt being deleted by delete task.

2nd run: Both tasks executed successfully with green ticks.. All data was deleted.

3rd run: Both tasks executed successfully with green ticks.. There was no data and after that how many times i run the package, i saw that data was not present in the table.

Now, can anyone say which task was executing and why did i see data in the first run and i saw no data from second run.

Upvotes: 1

Views: 661

Answers (1)

Tab Alleman
Tab Alleman

Reputation: 31785

Yes, if there are no Precedence Constraints forcing the tasks to run in a certain order, then they will run in parallel. There is no guarantee which order they will start/finish in.

The logical explanation for what you saw is:

1st Run - The Delete task finished first, and then the DataFlow task populated the table

2nd Run, and all runs thereafter, the DataFlow task finished first, and the Delete task finished last, deleting all the data.

Upvotes: 4

Related Questions