SolvedPrivate

SSIS task only after previous task is sucess

Posted on 2013-01-27
4
47 Views
Last Modified: 2016-02-10
Hi

i have SSIS package which has 2 tasks
task1. Execute SQl task
task 2. Move Processed file to archive directory

I want to execute task2 only when task1 is executed successfully. If Task1 is not executed not successfully, ( i mean if i get error while processing task1 that is while executing stored procedure ) , i do not want to execute task2
i am using Sql server 2005

thanks,
Ram
0
Comment
Question by:ram27
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
Saurabh Bhadauria earned 500 total points
ID: 38825759
For this you need to understand presidency control in SSIS

Look at below links..They have some nice screen shots and help you understand complete flow..

http://stackoverflow.com/questions/12958244/how-to-control-ssis-package-flow-based-on-record-count-returned-by-a-query

http://www.simple-talk.com/sql/ssis/working-with-precedence-constraints-in-sql-server-integration-services/

Thanks,
Saurabh
0
 
LVL 11

Expert Comment

by:SThaya
ID: 38826006
Here are the steps:

1.just give a Procendence constraint connection from task 1 to task 2 .
2. select the  Procendence constraint  link and select "Success" ..This will pass only the task 1 executes successfully

3. if the task 1 failed then your over all pakage will fail. in order to avoid that . create one more task (task 3){ send mail tak (or any other task) .}
4. connect Procendence constraint connection from task 1 to task 3 and select this Procendence constraint  link and right click select "Failure"
image.jpg
0
 
LVL 11

Expert Comment

by:SThaya
ID: 38826009
Screen shot
0
 

Author Comment

by:ram27
ID: 38827663
I tried  SThaya's approach
even my stored proc fails while executing,
Task 2 is executing
i want to execute task2 only when task1( Execute SQl task - which inter calls  stored proc ) is executed sucessfully.
I mean id there is any error while executing the stored proc , it should not execute task2
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now