Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DontExecuteTask in WorkFlow Properties

Status
Not open for further replies.

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" ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top