Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
infodemers
Posting Yak Master
183 Posts |
Posted - 2012-09-14 : 08:53:36
|
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 ThenDts.Variables("User::strLowSize").Value = LowSizeDts.TaskResult = ScriptResults.Failure 'Go to step "Send Email SQL Task" then on Success 'Go to step "BulkInsert SQL Task"ElseDts.TaskResult = ScriptResults.Success 'Go to step "BulkInsert SQL Task"End IfBecause 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
52326 Posts |
Posted - 2012-09-14 : 10:32:32
|
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 MVPhttp://visakhm.blogspot.com/ |
|
|
infodemers
Posting Yak Master
183 Posts |
Posted - 2012-09-14 : 11:02:01
|
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 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-14 : 11:03:20
|
yep.only difference being first two arrows in green (on success) rather than on completion along with expression------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
infodemers
Posting Yak Master
183 Posts |
Posted - 2012-09-14 : 11:41:15
|
Like This?https://picasaweb.google.com/lh/photo/NVtWwU5TG8grxcUtw1YSgNMTjNZETYmyPJy0liipFm0?feat=directlink |
|
|
infodemers
Posting Yak Master
183 Posts |
Posted - 2012-09-14 : 12:22:18
|
I got what you meant to say....It is now working !Thanks again for helping me! ;-) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-14 : 16:36:06
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|