Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Quad Cities

    Unanswered: Export to .txt file using SQL Server DTS

    I am exporting a SQL Server 2000 table to an "errors.txt" file. I can get this to work just fine. I need to be able to plug the date and record count into my file name...(ex. MMYYYYCCCCerrors.txt).

    The first 6 characters are the month and year of the file. CCCC represents a record count with leading zeroes.

    Current Process - An ASP page has an "Export" button on it. After the "Export" button is clicked, a Stored Proc is called and the SP executes the DTS package. The DTS package just copies the data from a table to a .txt file.


  2. #2
    Join Date
    Sep 2003
    Hello Len,

    I would propose that you add an ActiveXTask to your DTS-package, which manipulates the properties of your export task.

    This ActiveXskript defines a variable with your desired file name (e.g. MMYYYYCCCCerrors.txt) and checks if this files exists in OS level. If it does exist, increase CCCC by 1 and check again.

    For better help on this topic look at this article ( Generally, this site offers me quite a lot of help.

    Hope this helps you! Otherwise post a reply.


Posting Permissions

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