I have this block of code that is in a child package (see below).
The idea is, I want to be able to run the child package by calling it from the parent packageAND sometimes I want to be able to run the child package on its own, in which case it will not have access to the variables in the parent package, i.e. "TEST". That is, the"TEST" variable will not be "seen" by the child package because the TEST variable lives at the parent level, not the child level.
In the case of running the child package on its own, it won't find the TEST variable, and it should fail.
However, I do not want the script task to fail as I have a try catch block but it fails anyway even with the exit try. What am I missing please?
Thank you.
Try
Dim vars As Variables
Dts.VariableDispenser.LockForWrite(“TEST� 'this is a variablein the parent package
Dts.VariableDispenser.GetVariables(vars)
Try
vars(“TEST�.Value = “I’m Done�br>
Catch ex As Exception
Throw ex
Finally
vars.Unlock()
End Try
Catch ex As Exception
�what can I put here so that the script task does not fail?
Exit try
‘Throw ex - do not want this
End Try