DTS-package loop, setting table-name

DTS-package loop, setting table-name

Post by Euan Garde » Tue, 25 May 1999 04:00:00



Hi Horst,
Attached below is some sample code that should work, it does not change the
table
but the select statement, you should be able to change it. It relies on a
GlobalVariable
as a controller and an activex script task which is on sucess from the pump.

-Euan

Function Main()
 If DTSGlobalVariables("LoopController").Value = False then
     DTSGlobalVariables("LoopController").Value =True
     ResetConnection
 end if
 Main = DTSTaskExecResult_Success
End Function

Private Sub ResetConnection
 Dim oPackage
 Dim oPump

 set oPackage = DTSGlobalVariables.Parent
 set oPump = oPackage.Tasks("BuildMini_Task").CustomTask

 oPump.SourceSQLStatement = "SELECT City, Region, Country FROM Customers"
 oPackage.Steps("BuildMini_Task_Step").ExecutionStatus =
DTSStepExecStat_Waiting
End Sub

Quote:> Hello!

> I have a (unknown) list of dBase-Files in a known directory. All these
> files have the same structure and I have to merge all the data in one
> SQL table.

> I succeeded in establishing a loop through all the dbf-files and for
> testing I pop up a message box which displays the actual filename.

> And here is my problem: inside the data pump (no query, just copying)
> I have to set the tablename to the name of the file. How can I set the
> table name via an active script task?

> Thank you in advance

> Horst Gassner
> SkiData AG Austria
> http://www.skidata.com

 
 
 

DTS-package loop, setting table-name

Post by Horst Gassn » Wed, 26 May 1999 04:00:00


Hello!

I have a (unknown) list of dBase-Files in a known directory. All these
files have the same structure and I have to merge all the data in one
SQL table.

I succeeded in establishing a loop through all the dbf-files and for
testing I pop up a message box which displays the actual filename.

And here is my problem: inside the data pump (no query, just copying)
I have to set the tablename to the name of the file. How can I set the
table name via an active script task?

Thank you in advance

Horst Gassner
SkiData AG Austria
http://www.skidata.com

 
 
 

DTS-package loop, setting table-name

Post by Horst Gassn » Thu, 27 May 1999 04:00:00


Hello Euan,

thank you for your solution.
I have one problem with this:
I don't know which name I have to insert for the task in line

set oPump = oPackage.Tasks("BuildMini_Task").CustomTask

I tried to insert the description text of the data pump task, but this
does not work ("Task 'xxx' was not found"). What is generally the
naming convention of Tasks, Pumps, Steps, ActiveX Scripts and so on?

Thank you in advance

Horst Gassner
SkiData AG Austria
http://www.skidata.com

 
 
 

DTS-package loop, setting table-name

Post by Euan Garde » Thu, 27 May 1999 04:00:00


Horst,
If you use the ScriptPkg program in the Dev Tools dir it will write VB code
that
creates the package, you will get the name from there.

-Euan

Quote:> Hello Euan,

> thank you for your solution.
> I have one problem with this:
> I don't know which name I have to insert for the task in line

> set oPump = oPackage.Tasks("BuildMini_Task").CustomTask

> I tried to insert the description text of the data pump task, but this
> does not work ("Task 'xxx' was not found"). What is generally the
> naming convention of Tasks, Pumps, Steps, ActiveX Scripts and so on?

> Thank you in advance

> Horst Gassner
> SkiData AG Austria
> http://www.skidata.com

 
 
 

DTS-package loop, setting table-name

Post by Horst Gassn » Fri, 28 May 1999 04:00:00


Hi Euan,

Quote:>If you use the ScriptPkg program in the Dev Tools dir it will write VB code
>that
>creates the package, you will get the name from there.

Thanks again, the script now works. :-)

But is there no other way to get the names of the Tasks, Steps etc..?
To get the names just with the help of the ScriptPkg program seems a
little bit awkward to me.

Nice greetings

Horst Gassner
SkiData AG Austria
http://www.skidata.com

 
 
 

DTS-package loop, setting table-name

Post by Euan Garde » Fri, 28 May 1999 04:00:00


Hi,
To get the pump task name in the designer you can look at the workflow
properties/options.
That will give you a step name like DTSStep_DTSPumpTask_1.
Change the name from Step to Task and you have the task name.

-Euan


Quote:> Hi Euan,

> >If you use the ScriptPkg program in the Dev Tools dir it will write VB
code
> >that
> >creates the package, you will get the name from there.
> Thanks again, the script now works. :-)

> But is there no other way to get the names of the Tasks, Steps etc..?
> To get the names just with the help of the ScriptPkg program seems a
> little bit awkward to me.

> Nice greetings

> Horst Gassner
> SkiData AG Austria
> http://www.skidata.com

 
 
 

1. Referencing DTS package name from within the DTS package

Is it possible to access the name of the DTS package from a "Execute
SQL Task" within the DTS package?

I have a stored procedure that writes entries to a log table and is
called at various points in several DTS packages and sub-DTS packages.

I want this to be able to write the name of the DTS package that
called it in the log table. If there are several nested DTS packages,
it should return the immediate parent.

I'm using SQL Server 7.00.842 (SP3?).

Paul.

2. 2.6 => Need to BROWSE inside a window with other controls

3. Change DBF Table Name in DTS Package Programatically

4. TurboPAL: how well does

5. VB and DTS packages - Custom server and package names

6. Log shipping

7. DTS , looping and failure of one ActiveX Task causing the Package to Stop

8. Paradox Engine under BC++OS/2

9. Need some kind of Loop in a DTS package

10. looping a DTS package

11. Calling DTS package in a Loop (newbie...)

12. DTS Package Loop?

13. Looping dts package