Script Controlled Dynamic Task Execution
From: Brad (Brad_at_discussions.microsoft.com)
Date: 10/27/04
- Next message: ermedin: "Re: How to carry forward a balance or last known value"
- Previous message: theonlyhenni: "accessing dts via vb"
- Next in thread: Allan Mitchell: "Re: Script Controlled Dynamic Task Execution"
- Reply: Allan Mitchell: "Re: Script Controlled Dynamic Task Execution"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 27 Oct 2004 05:17:01 -0700
Good morning.
I have a package in which I have three text files with three matching
Transformation Tasks into my SQL Server database. My problem is that I may
need to execute one transformation on a text file, then execute that same
transformation on another text file, and skip the other two text files and
their transformations.
So essentially, I have a script that wants to take complete control of the
Package as far as source connections and task executions, however I'm not
completely sure how to do this.
My script changes the source connections for each Text Connection item, but
then it is unable to execute the task and furthermore stop Package execution
once the Script has finished its run.
Here's the meat of this part of the script:
[code]
' Reports is now built. Iterate through it evaulating the Report Name
' Iterator
dim v
' This package
dim oPkg
set oPkg = DTSGlobalVariables.Parent
' The DataPumpTask to execute
dim oTsk
For Each v in Reports
' Evaluate the name using a select statement.
Select Case v.ReportName
Case "Historical\Designer\Split Summary"
oPkg.Connections("Split Statistics").DataSource = v.ExportFileName
set oTsk = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask
Case "Historical\Designer\Interval Productivity Detail by Split"
oPkg.Connections("Agent Statistics").DataSource = v.ExportFileName
set oTsk = oPkg.Tasks("DTSTask_DTSDataPumpTask_2").CustomTask
Case "Historical\Designer\Interval Login/Logout by Split"
oPkg.Connections("Agent Logout Statistics").DataSource = v.ExportFileName
set oTsk = oPkg.Tasks("DTSTask_DTSDataPumpTask_3").CustomTask
Case Else
' Unhandled. Do something about this.
End Select
' The source file has been changed. Now, execute the transformation task.
oTsk.Execute
Next
' Now exit the package since we're done.
[/code]
I know that oTsk.Execute does not work because of missing parameters, and
looking at the parameters I'm supposed to specify I get even more confused.
The Execute method of the CustomTask object has these parameters:
pPackage, pPackageEvents, pPackageLog, pTaskResult
I'd really appreciate any feedback on what I'm trying to do here.
Thank you!
- Next message: ermedin: "Re: How to carry forward a balance or last known value"
- Previous message: theonlyhenni: "accessing dts via vb"
- Next in thread: Allan Mitchell: "Re: Script Controlled Dynamic Task Execution"
- Reply: Allan Mitchell: "Re: Script Controlled Dynamic Task Execution"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|