precedence constraint and expression problem
I have now tried setting my second expression as: @counter < 1 So that means I have covered all scenarios. But still none of the following tasks gets executed. How do I configure a script task to show me what value @counter has?
September 28th, 2012 6:06am

Connect a script component to your first execute sql task, specify [User::Counter] under ReadOnlyVariables and stick the following code into the script task: public void Main() { System.Windows.Forms.MessageBox.Show(Dts.Variables["User::Counter"].Value.ToString()); Dts.TaskResult = (int)ScriptResults.Success; } Also can you post an image of your control flow and specify whats the datatype of column which sets value of the variable. http://btsbee.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2012 6:19am

Hi Cloxy, Instead of creating a script component to display the value of @Counter variable, right click the first execute sql task, set break post on post execute event. Execute the package, go to Debug tab -> Windows -> Locals, Now expand the variables and check the value it(@Counter) holds. Rajkumar
September 28th, 2012 6:57am

Thank you both for your support! Now I have learned how to add breakpoints, something which I have missed dearly in SSIS.. :) I added breakpoint as you described and to my astonishment it had a value of 'null' ??? I changed variable from Int32 to Int16 and voil! Now it runs like a charm! I still think it's weird, but ah.. I don't care, now it is working :) Thanks!
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2012 9:35am

I have an Execute SQL Task which populates a variable of type Int32 (default value 0). After this task I have two other Execute SQL Tasks. I only want to execute one of these, not both. I have set up precedence constraint to both tasks with "Expression and Constraint". Constraint must be Successfull and for the first Task Expression is as: @counter > 0 The other task has Expression: @counter == 0 But whenever I run my package the first task executes and gets green, but none of the other does. I have tried putting them both "Logical OR" but no difference. Please help?
October 1st, 2012 5:31am

In that case the value set in counter must be less than 0 and since none of the contraints cater for that neither are executed. Use a script component to display the value of the counter in a message box after you have executed the first script to debug what value is actually being set in the variable.http://btsbee.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
October 1st, 2012 5:41am

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

Other recent topics Other recent topics