Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Export to Excel Hundreds of files

Author  Topic 

javathehutt
Starting Member

1 Post

Posted - 2006-03-21 : 19:52:28
Hi Gurus,

I have successfully used DTS to schedule afew daily queries to be run against a few tables. The data is exported into an Excel format on a shared drive. There are several Excel files to write to and I have those mapped in the DTS tool. Lets say I have SQL Query data exported to Excel File A. My question is

1) How do I go about creating a time stamp on that Excel A file's SHEETS tab eg, 03-20-2006, 03-21-2006, 03-22-2006 instead of having the default 'Results' as the tabs default name.

2) How do I prevent overwriting of the data on the sheets. When data is extracted from the DB, will it create a new sheet of data on that Excel file A?

Your help is much appreciated! Thanks!

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-03-22 : 06:55:32
Add an extra step to the DTS to rename the excel file, this will need to be a xp_cmdshell call I think.. You will also probably need a step at the beginning to rename a template file (So Excel doesn't change it's starting point for data to be written)..
Go to Top of Page
   

- Advertisement -