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 2005 Forums
 SSIS and Import/Export (2005)
 create excel file is ssis

Author  Topic 

collie
Constraint Violating Yak Guru

400 Posts

Posted - 2008-02-06 : 04:46:35
Hi,

I have a package that writes information to a table in sql server 2005. I created an Excel file called ErrorLog.xls with column headers:
AccountNumber and Date.
I have a Data Flow Task that inserts from SQL into the Excel File.
This works fine the first time.
However, I then want to rename the Excel File, delete and recreate it with just the column headers AccountNumber and Date.
I need the Excel file to be empty every time the package runs.
I am able to create an Excel File using Script Component but how can I also add the headers?
Thanks

Whisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-02-06 : 11:32:49
You could look at a slightly different solution, which would be to: 1)create a template file
2)as the first part of the job - move the file from a directory into the relevant path , and then continue on with the job.


Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

collie
Constraint Violating Yak Guru

400 Posts

Posted - 2008-02-07 : 05:42:59
hi,

I did as you suggested.

Thanks :-)

Whisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.
Go to Top of Page
   

- Advertisement -