Execute SQL Task with 2 Paths using Expressions and Constraints
I have an Execute SQL Task that runs a stored procedure which populates an SSIS variable using an Output Parameter. I want the Flow to go one direction if a valid value (>0)is returned to the Variable and another if in an Invalid value (<=0) is returned. If the Execute SQL Task succeeds the package just stops without going to either path. If the Execute SQL Task has an error the Error Handler does fire. I have tried setting the constraint to Expression and Completion and Expression, but neither works. Below is an image of Any ideas?
August 4th, 2011 5:26pm

Can't see the image?
Free Windows Admin Tool Kit Click here and download it now
August 4th, 2011 5:32pm

You didn't mentioned where you have problem; did you fetched result of stored procedure into package variable successfullly? Did you set the precedence constraints with your expression like @[User::Var1]>0 ? did you do both steps successfully? tell us exactly where you got errors http://www.rad.pasfu.com My Submitted sessions at sqlbits.com
August 4th, 2011 6:24pm

Oops. I started to put in the image, but had to leave work before I had "cleansed" it. My issue is that I am not getting an error, it is just not going on to the next step. The Execute SQL Task is working as I see the procedure called using Profiler. The section looks something like this: The first EST runs, but neither following task is executed. In the case of the real package the variable value is -1. I suppose it could be the variable naming as I am just doing @variable not @[User::variable]. I'll have to try that tomorrow.
Free Windows Admin Tool Kit Click here and download it now
August 4th, 2011 10:52pm

Try debug the package with breakpoints and check the value of the variable fetched from the first Execute sql task using Locals window.Also re check the parameter confguration in Execute sql task.Happy to help! Thanks. Regards and good Wishes, Deepak. In a revamp of my Blog!
August 5th, 2011 1:59am

I am agree with Deepak, right click on EST-Get output parameter task and select edit break points then set a break point on OnPostExecute. and at runtime when control flow paused at that breakpoint check value of your variable in watch or locals window and check if the value is as you expected or not?http://www.rad.pasfu.com My Submitted sessions at sqlbits.com
Free Windows Admin Tool Kit Click here and download it now
August 5th, 2011 4:33am

Okay. My issue was NOT with the precedence constraints. It was the fact that the step on the right goes directly to an Execute SQL Task and the step on left does some processing and ALSO goes to the same Execute SQL Task. The issue was I had precedence Constraint set to Logical AND which could NEVER happen. I changed it to Logical OR and I get continued processing. Although I do have another issue that I will post on a separate thread.
August 5th, 2011 11:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics