dbTalk Databases Forums  

Re: Clearing Excel Spreadsheet before exporting data to it.

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


Discuss Re: Clearing Excel Spreadsheet before exporting data to it. in the microsoft.public.sqlserver.dts forum.



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

Default Re: Clearing Excel Spreadsheet before exporting data to it. - 09-02-2003 , 04:19 PM






See thread about Renaming an Excel file in a package.

Here's my answer to him. Should work for you as well.

Fred,
I had the same problem a while ago. My solution was to create a template
Excel workbook. After renaming the populated Excel Workbook, I'd then
rename {reportname}.template.xls to {reportname}.xls So that the file is
ready to go the next time the dts package runs.

It's not pretty, but it works pretty well.

--
Denny Cherry
DBA
GameSpy Industries
"Andrew" <afriedl (AT) data-source (DOT) com> wrote

Quote:
I am exporting rows of data from a single table to excel through DTS.

Unfortunately, DTS continues to ADD the data form the table to the rows in
the spreadsheet. Is there a way to clear the spreadsheet of data BEFORE
the
new data is added?

I tried adding an EXECUTE SQL TASK to the package that included: the
statement:

'DELETE FROM MyTableData'

And this runs, but the data is not cleared from my spreadsheet, it
continues
to append rows to existing rows. I even tried deleting the data manually,
however, this seems to break the DTS pacvkage completely.

Thanks,
Andrew





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.