• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1072
  • Last Modified:

SSIS - Expression and Constraint

Hi, I coded a Expression and Constraint in my package and although I know the value is true, "Yes", it is not kicking off my next SQL task that executes a proc.
0
Laura2112
Asked:
Laura2112
  • 4
  • 3
  • 2
  • +1
1 Solution
 
i2mentalCommented:
Going to need more info. Can you please post the syntax you are using to evaluate the expression?
0
 
HoggZillaCommented:
I am going to write you a script task to display the values immediately following the precedence event. Coming in a bit. Thanks.
0
 
i2mentalCommented:
You can see the values just by putting a break point on the next step and stepping into the code. Look in the "Locals" tab and find your variable. More importantly is how you're testing against that variable in your expression. The syntax is picky and will test as true innacurately if not done right

Example: @[User::FileExists] == 1
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
PedroCGDCommented:
do you have 2 rows linked to same task?
Regards!
Pedro

www.pedrocgd.blogspot.com
0
 
HoggZillaCommented:
Laura,
Drag a Script Task into the Control Flow window. Grab the green arrow from your Execute SQL Task which populates the Answer variable and connect it to the new Script Task.
In the Script Task, type in the name of your variable (in this case, Answer) into the ReadOnlyVariables property.
In the Script Task put the following code. This will popup a message box with the Answer variable value. Let's verify it is what we think it is "Yes".

Public Sub Main()
        '
        ' Add your code here
        '
        Dim WhatIsTheAnswer As String
        WhatIsTheAnswer = Dts.Variables("Answer").Value.ToString
        MsgBox(WhatIsTheAnswer, MsgBoxStyle.OkOnly, "Survey Says ...")
 
	Dts.TaskResult = Dts.Results.Success
End Sub

Open in new window

answer-variable.bmp
0
 
HoggZillaCommented:
I just noticed, you have the CASE statement write the word "YES" in uppercase and then in your precedence constraint you have a mixed case "Yes". Shame .... LOL. :-)
0
 
Laura2112Author Commented:
Silly SQL!  I am looking forward to getting to this later today. Thnks Steve!!
0
 
Laura2112Author Commented:
Man, I am just getting a chance to look at this!  you were right, the upper/lower case made the difference. Now the only problem I have is that the parameters are not set correctly or the syntax is wrong in the third SQLTask. I will try to do what you suggested using script to see what the start and end dates look like. Have a greast weekend!  
0
 
HoggZillaCommented:
Great!!! Let us know when you get to the next step.
0
 
Laura2112Author Commented:
Thanks HoggZilla, I will have to pick this back up when they give me mored time at work. I apopreciate your help!  You got me the answer that I needed. I will test further and post another question iof need be. Take care.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now