Home > Archive > MS SQL Server DTS > April 2006 > SQL 2K: Help needed with dynamic output file names









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SQL 2K: Help needed with dynamic output file names
Matthew Speed

2006-03-30, 11:28 am

I have been asked to produce a set of csv output files for a number of
subsets of data from a database. I have created a DTS package that
can output each query to a hardcoded filename specified in the
Destination file object in the package. As I have to do this
appoximately 160 times I need to know how to change the name of the
target file programmatically.

I am guessing this will use an ActiveX script within the package to
modify the target as the first action in the script. Can someone
point me in the right direction to learn to be able to modify a
property internal to the package by using an action in the package
itself?

TIA
Bill Swartz

2006-04-02, 3:27 am

Matthew,

What I would do is use the dynamic properties task to manage the file name
for the Destination file.

So the flow would be.

Use ActiveX to set the file name and update a global variable.
DTSGlobalVariables("ExportFilename").Value = myNewFileName

Execute the DynamicPropertiesTas
k to set the DestinationFile name based on
the global variable.
Execute the export

Bill


"Matthew Speed" <mspeed@mspeed.net> wrote in message
news:q2vn22t246mnht7
12m98bd4fh5lkho0dhq@
4ax.com...
>I have been asked to produce a set of csv output files for a number of
> subsets of data from a database. I have created a DTS package that
> can output each query to a hardcoded filename specified in the
> Destination file object in the package. As I have to do this
> appoximately 160 times I need to know how to change the name of the
> target file programmatically.
>
> I am guessing this will use an ActiveX script within the package to
> modify the target as the first action in the script. Can someone
> point me in the right direction to learn to be able to modify a
> property internal to the package by using an action in the package
> itself?
>
> TIA



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com