Can SSIS execute tasks in specific order?

2019-02-25 09:03发布

问题:

HI

I am in process of creating an ssis package that need to do following in specified order:

1: process some data 2: move that data to some other tables 3: Get some data and push it in a plain text file.

I have created 3 store procedure for these, I have 2 "Execute SQL tasks" for 1 and 2 and a "Data Flow task" for 3rd.

Now when i run the package i can see all 3 step are completed (no errors) but they are not running in correct order.

I see step 3 is run first then step 1 and 2, i think then step 3 runs again. Normally i can ignore it but as the data in the text file can be 700 mb, i need to find a way to get SSIS to run these task in sequence.

I have tried "Sequence Container" but no luck.

Can some one help me with this please?

KA

回答1:

You need to use precedence constraints to tell SSIS what order your tasks need to be executed in.

Drag the green arrow from task one to task two, and from task two to task three.



回答2:

You could connect as

  1. first SQL execute task

  2. precedence constraint on success

  3. second SQL execute task

  4. precedence constraint on success

  5. data flow

SSIS will follow the sequence as we required.

thanks

prav



回答3:

I had exactly this problem. Tasks were being executed in something like the order I'd created them rather than the sequence I specified later. It turned out that I'd managed to get a task that belonged to the first sequence container to appear in the last sequence container without loosing it's allegiance to the first. I discovered this by taking a backup and deleting sequence containers - the rogue task disappeared when I deleted the first sequence container.

The fix was to cut and past the task into the desired sequence container.



回答4:

I encounterd an issue on SQL Server Denali when individual components were running out of sequence even though they were joined by success constraints. The problem seemed to occur when I had cut and pasted the components and the constraint. By deleting and reapplying the constraints, the package then ran in the correct order.



回答5:

In my case, if I want to decide execute order in sequence containers, I will use [sub sequence containers] between execute sql task and data flow task. Hope useful for you.



回答6:

The best is to use Sequence Containers... basically they help in creating a Sequence.

But since it does not work in your case, create Child Packages for all your different process and then create the Master Package which will have a link to those child packages, USE "Execute Package task"



标签: ssis