![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
You could set a global variable to true or false , then use a dynamic task to set the next step's DisableStep property to true or false from that global variable. |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
We have a scheduled package that will check the value in a table row and based on that value will either - run a series of steps including execute sql and activex - exit successfully detail we set the DB set Global Variable run a SQL query to determine if the package is running (its endtime is than startime meaning its running since one of the 1st steps is to update a row with it startime) this ExecuteSQL task has no input variable but generates an output variable (gvRunning) as an integer run a SQL query to determin if we should run (we ask fo a count of rows, if > 1 we run else not) this ExecuteSQL task has no input variable but generates an output variable (gvCount) as an integer at this point we want to do the following: if he output variable gvcount is = 0 or gvRunning = 1 we want to exit the whole package if the output variable is > 0 and the gvRunning = 0 we want to perform a series of step (activex, executeSQL etc) the solution we have come up with is - after getting gvCount and gvRunning run an Activex script that has 2 workflows. on success do the good stuff, and Function Main() if DTSGlobalVariables("gvCount").Value = "0" or DTSGlobalVariables("gvRunning").Value = "1" THEN Main = DTSTaskExecResult_Failure ELSE Main = DTSTaskExecResult_Success END IF End Function works great execpt of course that the package ends in a failure, logs get written message sent to DBA etc. we also tried this but everything gets done everytime Function Main() if DTSGlobalVariables("gvCountRequest").Value = "0" or DTSGlobalVariables("gvIsRunning").Value = "1" THEN Set oPkg = DTSGlobalVariables.Parent Set oExecSQL = oPkg.Tasks("DTSTask_DTSExecutePackageTask_3").Cust omTask oExecSQL.PackageName = "NBT_DummyPackage_DEV" Main = DTSTaskExecResult_Success ELSE Main = DTSTaskExecResult_Success END IF End Function anyone have any ideas on how to do this? we |
![]() |
| Thread Tools | |
| Display Modes | |
| |