![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi! Following code works just fine, until the global variable is set to true Function Main() Dim oPkg Set oPkg = DTSGlobalVariables.Parent If DTSGlobalVariables("UPGRADE").Value Then oPkg.Steps("DTSStep_SQLExecuteSQLTask_2").Value =DTSStepExecStat_Inactive oPkg.Steps("DTSStep_SQLExecuteSQLTask_4").Value =DTSStepExecStat_Inactive oPkg.Steps("DTSStep_SQLExecuteSQLTask_5").Value =DTSStepExecStat_Inactive End If Set oPkg = Nothing Main = DTSTaskExecResult_Success End Function I've also tried the link http://www.sqldts.com/?214 without understanding how it works. Forgive me for my ignorance, but what am I missing / doing wrong. Please help me. Any help appreciates. --------------- Best regards - Hans - --------------- |
#3
| |||
| |||
|
|
Maybe you should try: If DTSGlobalVariables("UPGRADE").Value = "True" Another thing you could try to debug is replace the code in the middle and see if it works: If DTSGlobalVariables("UPGRADE").Value Then MsgBox "This works." End if "Hans [DiaGraphIT]" a écrit : Hi! Following code works just fine, until the global variable is set to true Function Main() Dim oPkg Set oPkg = DTSGlobalVariables.Parent If DTSGlobalVariables("UPGRADE").Value Then oPkg.Steps("DTSStep_SQLExecuteSQLTask_2").Value =DTSStepExecStat_Inactive oPkg.Steps("DTSStep_SQLExecuteSQLTask_4").Value =DTSStepExecStat_Inactive oPkg.Steps("DTSStep_SQLExecuteSQLTask_5").Value =DTSStepExecStat_Inactive End If Set oPkg = Nothing Main = DTSTaskExecResult_Success End Function I've also tried the link http://www.sqldts.com/?214 without understanding how it works. Forgive me for my ignorance, but what am I missing / doing wrong. Please help me. Any help appreciates. --------------- Best regards - Hans - --------------- |
#4
| |||
| |||
|
|
Sorry I didn't make my self understood According to the link http://www.sqldts.com/?214 It shows how to skip a single task. What I want to do is if UPGRADE is set to true I want to jump over several tasks or jump to a spesific task and continue from there. Please help... -- --------------- Best regards - Hans - --------------- "fleo" wrote: Maybe you should try: If DTSGlobalVariables("UPGRADE").Value = "True" Another thing you could try to debug is replace the code in the middle and see if it works: If DTSGlobalVariables("UPGRADE").Value Then MsgBox "This works." End if "Hans [DiaGraphIT]" a écrit : Hi! Following code works just fine, until the global variable is set to true Function Main() Dim oPkg Set oPkg = DTSGlobalVariables.Parent If DTSGlobalVariables("UPGRADE").Value Then oPkg.Steps("DTSStep_SQLExecuteSQLTask_2").Value =DTSStepExecStat_Inactive oPkg.Steps("DTSStep_SQLExecuteSQLTask_4").Value =DTSStepExecStat_Inactive oPkg.Steps("DTSStep_SQLExecuteSQLTask_5").Value =DTSStepExecStat_Inactive End If Set oPkg = Nothing Main = DTSTaskExecResult_Success End Function I've also tried the link http://www.sqldts.com/?214 without understanding how it works. Forgive me for my ignorance, but what am I missing / doing wrong. Please help me. Any help appreciates. --------------- Best regards - Hans - --------------- |
#5
| |||
| |||
|
| "Hans [DiaGraphIT]" wrote: Sorry I didn't make my self understood According to the link http://www.sqldts.com/?214 It shows how to skip a single task. What I want to do is if UPGRADE is set to true I want to jump over several tasks or jump to a spesific task and continue from there. Please help... -- --------------- Best regards - Hans - --------------- "fleo" wrote: Maybe you should try: If DTSGlobalVariables("UPGRADE").Value = "True" Another thing you could try to debug is replace the code in the middle and see if it works: If DTSGlobalVariables("UPGRADE").Value Then MsgBox "This works." End if "Hans [DiaGraphIT]" a écrit : Hi! Following code works just fine, until the global variable is set to true Function Main() Dim oPkg Set oPkg = DTSGlobalVariables.Parent If DTSGlobalVariables("UPGRADE").Value Then oPkg.Steps("DTSStep_SQLExecuteSQLTask_2").Value =DTSStepExecStat_Inactive oPkg.Steps("DTSStep_SQLExecuteSQLTask_4").Value =DTSStepExecStat_Inactive oPkg.Steps("DTSStep_SQLExecuteSQLTask_5").Value =DTSStepExecStat_Inactive End If Set oPkg = Nothing Main = DTSTaskExecResult_Success End Function I've also tried the link http://www.sqldts.com/?214 without understanding how it works. Forgive me for my ignorance, but what am I missing / doing wrong. Please help me. Any help appreciates. --------------- Best regards - Hans - --------------- Simpley change your workflow to Success (green arrow) to a task if OK and on failure to another task or even on failure close package. |
![]() |
| Thread Tools | |
| Display Modes | |
| |