Results 1 to 2 of 2

Thread: Importing all the text file in a directory using DTS

  1. #1
    Join Date
    Sep 2005
    Posts
    1

    Exclamation Importing all the text file in a directory using DTS

    Hi everyone

    Thanks for reading and helping me out of this problem.
    I have a directory where I have text file with date as a file name, thus all the files have different file names.

    But I want to do is import all the text files into sql server 2000 ,right now i have a DTS package which i have up upload all the text files manually , I do not know how to loap it so that it DTS funcation check all the files in a directory and import it into database.

    I will appreciate if anyone can help me out of this .

  2. #2
    Join Date
    Dec 2004
    Posts
    502
    How about if you combined all the files into one text file first and then import it? If your files are like this:

    C:\file1.txt
    C:\file2.txt
    C:\file3.txt

    Use this command to combine them:

    type C:\*.txt > C:\folder1\combinedfile.txt

    And then import that combined file. Be careful about using the type command with wildcards like I did above. If I had put the combined file into the same directory as the other files:

    type C:\*.txt > C:\combinedfile.txt

    it would have actually doubled up the file because it would have put "C:\combinedfile.txt" into itself.

Posting Permissions

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