DBAchick
Programmer
- Apr 27, 2000
- 61
I have an execute process task in my DTS Package that I only want executed if a Global Variable value = Y.
Here is my code:
Function Main()
' Check global variable from package
If DTSGlobalVariables("sZipFlag".Value = "Y" Then
Main = DTSStepScriptResult_ExecuteTask
Else
Main = DTSStepScriptResult_DontExecuteTask
Main = DTSStepExecStat_Completed
End If
Main = DTSTaskExecResult_Success
End Function
I have the DTSStepExecStat_Completed line in there for the next step in the package.
My issue is: The Task executes regardless of the global variable value.
I have checked the data type of the global variable, it is a string. I have added msgboxs to the code to make sure that the value is being evaluated correctly and it is, a value of "N" drops the code into the ELSE statements.
How do I prevent the task from being executed if the global variable value = "N" ??
Here is my code:
Function Main()
' Check global variable from package
If DTSGlobalVariables("sZipFlag".Value = "Y" Then
Main = DTSStepScriptResult_ExecuteTask
Else
Main = DTSStepScriptResult_DontExecuteTask
Main = DTSStepExecStat_Completed
End If
Main = DTSTaskExecResult_Success
End Function
I have the DTSStepExecStat_Completed line in there for the next step in the package.
My issue is: The Task executes regardless of the global variable value.
I have checked the data type of the global variable, it is a string. I have added msgboxs to the code to make sure that the value is being evaluated correctly and it is, a value of "N" drops the code into the ELSE statements.
How do I prevent the task from being executed if the global variable value = "N" ??