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.
Author |
Topic |
Gopher
Yak Posting Veteran
83 Posts |
Posted - 2010-09-02 : 08:11:07
|
Hi AllI 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_DontExecuteTaskElse Main = DTSStepScriptResult_ExecuteTaskEnd ifEnd FunctionBut i cannot get it to work in a SQL 2005 SSIS package.Any Ideas?ThanksGopher |
|
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 SubBut I would prefer not to use the Success and failure, just need to work out how to use the DTSStepScriptResult values. |
|
|
|
|
|