Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Comparing NULLL values from SSIS Variables

Author  Topic 

Gopher
Yak Posting Veteran

83 Posts

Posted - 2010-09-02 : 08:11:07
Hi All


I need to create a script that checks to see if a variable value is NULL, if it is then it executes the next SQL Task and if not then the package has finished.

I have this in a SQL 2000 DTS package script:

Function Main()
If isnull(DTSGlobalVariables("NextLoadDate")) Then
Main = DTSStepScriptResult_DontExecuteTask
Else
Main = DTSStepScriptResult_ExecuteTask
End if
End Function


But i cannot get it to work in a SQL 2005 SSIS package.

Any Ideas?

Thanks
Gopher

Gopher
Yak Posting Veteran

83 Posts

Posted - 2010-09-02 : 08:53:23
I have managed to come up with a script:

Public Sub Main()
If Dts.Variables("NextLoadDate").Value.ToString <> "" Then
Dts.TaskResult = Dts.Results.Success
Else
Dts.TaskResult = Dts.Results.Failure
End If
End Sub

But I would prefer not to use the Success and failure, just need to work out how to use the DTSStepScriptResult values.
Go to Top of Page
   

- Advertisement -