dbTalk Databases Forums  

SQL 2K: Help needed with dynamic output file names

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SQL 2K: Help needed with dynamic output file names in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Matthew Speed
 
Posts: n/a

Default SQL 2K: Help needed with dynamic output file names - 03-30-2006 , 10:51 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

Reply With Quote
  #2  
Old   
Bill Swartz
 
Posts: n/a

Default Re: SQL 2K: Help needed with dynamic output file names - 04-02-2006 , 02:03 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 DynamicPropertiesTask to set the DestinationFile name based on
the global variable.
Execute the export

Bill


"Matthew Speed" <mspeed (AT) mspeed (DOT) net> wrote

Quote:
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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.