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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS again

Status
Not open for further replies.

Morningstarr

Programmer
Mar 13, 2002
24
US
I have a DTS package in SQL Server 7, within the package the steps are: an active x script, SQLServer source, text file destination and three datapump tasks running from source to destination. I want to have the active x script in the begining, stop two of those datapumps from running by setting their execution status to inactive. Something similar to what is below (that does not work)

USPump = "DTSStep_DTSDataPumpTask_1"
PRPump = "DTSStep_DTSDataPumpTask_2"
EBPump = "DTSStep_DTSDataPumpTask_3"

Set oPkg = DTSGlobalVariables.Parent
oPkg.Steps(USPump).ExecutionStatus = _ DTSStepExecStat_Inactive
oPkg.Steps(PRPump).ExecutionStatus = _ DTSStepExecStat_Inactive
The example that I was pointed to before, although helpful, uses objects only available in SQL 2000. Is there anyway to do this in SQL 7?
Thanks,
Dawn
 
I found the solution, I'll post it here in case someone else ever has the same problem.
Thanks again, Dawn
'To Run task 2 and shut off task 1
Function Main()
Dim oPkg
Dim oStep
USPump = "DTSStep_DTSDataPumpTask_1"
PRPump = "DTSStep_DTSDataPumpTask_2"

Set oPkg = DTSGlobalVariables.Parent
Set oStep = GetStep(oPkG.Steps, USPump)
oStep.disablestep = TRUE
Main = DTSTaskExecResult_Success
End Function
Function GetStep(oSteps, sStepName)
' Get Step by Name
Dim oStep
For Each oStep In oSteps
If oStep.Name = sStepName Then
Set GetStep = oStep
Exit For
End If
Next
End Function


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top