Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Location
    Southern California
    Posts
    35

    Question Unanswered: Adding the Date to Filename of DTS Export

    I'd like to add the date to the file name of a DTS Export.

    For Example:
    Export092503.xls

    I've tried various methods but nothing has worked as of yet.

    Any ideas?

    Thanks in Advance.

    TechRick

  2. #2
    Join Date
    Aug 2003
    Location
    Andover, MA
    Posts
    256
    I export a standard file name, then rename using a BAT file. Here's the BAT file I use...

    --------------------------------------------------------------
    @echo off

    c:
    cd \SQL_Support_Applications\FTP Scripts\SONIC_Data

    IF EXIST CUST_%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%.dat DEL CUST_%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%.dat

    IF EXIST CUST_raw.dat REN CUST_raw.dat CUST_%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%.dat

    EXIT
    --------------------------------------------------------------

    It checks to see if the dated file exists and deletes before renaming.
    -bpd

  3. #3
    Join Date
    Sep 2003
    Location
    Germany
    Posts
    63
    Hi TechRick!

    If I get you correct, you run an data export task in a dts package.

    In this case you can use an ActiveXTask in this package to get the system date and modify the properties of the export task. A similar example is shown here: http://www.sqldts.com/default.aspx?231

    Hope this helps you!

    Greetings,
    Carsten

Posting Permissions

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