Results 1 to 5 of 5

Thread: Empty Excel file before DTS

  1. #1
    tony Guest

    Empty Excel file before DTS

    Hi, folks,

    How can I empty an existing excel file before using DTS to export new data in this excel file? Or is there any way to delete this excel file from DTS task?

    Thank you very much

    Tony

  2. #2
    Mohammed. Guest

    Empty Excel file before DTS (reply)

    Use SQL TASK to do this ...
    Write a query for excel...
    drop table <tablename>
    go
    Create table tablename.....
    Execute this SQL TASK before exporting the data to excel...

    Mohammed.


    ------------
    tony at 10/5/01 12:21:29 PM

    Hi, folks,

    How can I empty an existing excel file before using DTS to export new data in this excel file? Or is there any way to delete this excel file from DTS task?

    Thank you very much

    Tony

  3. #3
    Ray Miao Guest

    Empty Excel file before DTS (reply)

    There is a code list for this in Oct.&#39;s sql server magazine.


    ------------
    tony at 10/5/01 12:21:29 PM

    Hi, folks,

    How can I empty an existing excel file before using DTS to export new data in this excel file? Or is there any way to delete this excel file from DTS task?

    Thank you very much

    Tony

  4. #4
    tony Guest

    Empty Excel file before DTS (reply)

    Thank you, but where I can find that SQL server magazine? Can I read that on web?


    ------------
    Ray Miao at 10/5/01 2:12:46 PM

    There is a code list for this in Oct.&#39;s sql server magazine.


    ------------
    tony at 10/5/01 12:21:29 PM

    Hi, folks,

    How can I empty an existing excel file before using DTS to export new data in this excel file? Or is there any way to delete this excel file from DTS task?

    Thank you very much

    Tony

  5. #5
    SP Guest

    Empty Excel file before DTS (reply)


    It&#39;s simple, have another step as first step to refresh the excel file with a blank excel file(this is a blank file without the data but column headers) each time the job runs.This new step will be &#39;operating system command&#39;.Here is the command:


    copy \SERVERNAME...
    eportxyz_report_template.xls \SERVERNAME...
    eportxyz_report.xls


    or you can run the above refresh script by using xp_cmdshell.

    Hope that helps!


    ------------
    tony at 10/5/01 2:29:27 PM

    Thank you, but where I can find that SQL server magazine? Can I read that on web?


    ------------
    Ray Miao at 10/5/01 2:12:46 PM

    There is a code list for this in Oct.&#39;s sql server magazine.


    ------------
    tony at 10/5/01 12:21:29 PM

    Hi, folks,

    How can I empty an existing excel file before using DTS to export new data in this excel file? Or is there any way to delete this excel file from DTS task?

    Thank you very much

    Tony

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •