Re: Script Controlled Dynamic Task Execution
From: Allan Mitchell (allan_at_no-spam.sqldts.com)
Date: 10/28/04
- Next message: Allan Mitchell: "Re: MASSIVE DTS bug introduced with XP SP2"
- Previous message: Allan Mitchell: "Re: Using global variable in ExecuteSQL task"
- In reply to: Brad: "Script Controlled Dynamic Task Execution"
- Next in thread: Brad: "Re: Script Controlled Dynamic Task Execution"
- Reply: Brad: "Re: Script Controlled Dynamic Task Execution"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 28 Oct 2004 20:20:45 +0100
OK
Have a look at this, see if it makes sense to you, see if it does what you
want then let us know
Looping, Importing and Archiving
(http://www.sqldts.com/default.aspx?246)
--
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know
"Brad" <Brad@discussions.microsoft.com> wrote in message
news:8B743BE6-F50D-49C4-B80B-2D886FD60FE0@microsoft.com...
> 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: Allan Mitchell: "Re: MASSIVE DTS bug introduced with XP SP2"
- Previous message: Allan Mitchell: "Re: Using global variable in ExecuteSQL task"
- In reply to: Brad: "Script Controlled Dynamic Task Execution"
- Next in thread: Brad: "Re: Script Controlled Dynamic Task Execution"
- Reply: Brad: "Re: Script Controlled Dynamic Task Execution"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|