Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 SSIS branch failure and success
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

infodemers
Posting Yak Master

Canada
183 Posts

Posted - 09/14/2012 :  08:53:36  Show Profile  Reply with Quote
Hi everyone,

I have a script task with a validation. On failure, I wish to branch on a Execute SQL Task to send an email and then go to the step after the Scrip Task, and on Success, just go to the next step.


If Not (LowSize) Is Nothing Then
Dts.Variables("User::strLowSize").Value = LowSize
Dts.TaskResult = ScriptResults.Failure 'Go to step "Send Email SQL Task" then on Success 'Go to step "BulkInsert SQL Task"
Else
Dts.TaskResult = ScriptResults.Success 'Go to step "BulkInsert SQL Task"
End If

Because it is successfull it does not go to next step. Is it because I cannot have a Failure branch and a success branch?

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 09/14/2012 :  10:32:32  Show Profile  Reply with Quote
one way to do this is to add a boolean variable for notification and set it inside script task. then use expression and constraint as precedence constraint option to connect to execute sql and next task. for execute sql set expression as @variable == True and for next task set precedence condition from script task as @variable == False. for precedence from execute sql to next task set it only constraint option and on success. for the next task set multiple constraint option as OR

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

infodemers
Posting Yak Master

Canada
183 Posts

Posted - 09/14/2012 :  11:02:01  Show Profile  Reply with Quote
Hi,
If I understand you correctly, it should look like the image at the following URL?
https://picasaweb.google.com/lh/photo/tlb7g11RvjrK3bZzYoWphNMTjNZETYmyPJy0liipFm0?feat=directlink
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 09/14/2012 :  11:03:20  Show Profile  Reply with Quote
yep.only difference being first two arrows in green (on success) rather than on completion along with expression

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

infodemers
Posting Yak Master

Canada
183 Posts

Posted - 09/14/2012 :  11:41:15  Show Profile  Reply with Quote
Like This?
https://picasaweb.google.com/lh/photo/NVtWwU5TG8grxcUtw1YSgNMTjNZETYmyPJy0liipFm0?feat=directlink
Go to Top of Page

infodemers
Posting Yak Master

Canada
183 Posts

Posted - 09/14/2012 :  12:22:18  Show Profile  Reply with Quote
I got what you meant to say....It is now working !

Thanks again for helping me! ;-)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 09/14/2012 :  16:36:06  Show Profile  Reply with Quote
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000