DTS package to append query results in a text file

Posted on 2004-11-09
Last Modified: 2010-08-05
I have a DTS package that takes the results of a query and writes them to a text file. The problem I have is that each time the package runs, it overwrites the text file; I would like it to append the new results to the text file.

The current DTS package has 3 elements, the connection to my server, a data transform task, and the connection to the destination text file. I see no properties of the transformation that allow me to select an 'append' option'.

Thanks for any help.
Question by:hlevine5
    1 Comment
    LVL 32

    Accepted Solution

    I just condicted a test, and worked out a way to do this.  It involves adding one more step to the process.

    With your current process, direct the output to an interim/working file, not the final destination.
    Create a .BAT file with a command similar to this one:

    Type WorkFile.Txt >> DataFile.txt

    Place this in the working directory where you have the text files

    Add an execute process task to execute the .BAT file.  This will append the output to the final text file.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now