SolvedPrivate

SSIS task only after previous task is sucess

Posted on 2013-01-27
4
49 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

863 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

27 Experts available now in Live!

Get 1:1 Help Now