Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Multiple text file import

Author  Topic 

TheMilkMan
Starting Member

10 Posts

Posted - 2002-04-23 : 05:59:27
Hi gang,
I have 40 text files may have more sometimes.
The question is: is there an easy way to import all files at once or do i have to manualy set up all the text file transformations individually.
Thanks inadvance
jd

// SlowlyGetting There //

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2002-04-23 : 06:56:18
presume here that each import file is the same structure as the others....otherwise...the answer is yes...individual file transformations....


but searching here...(forum search) for DTS directory (all words)...turns up several links, including http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=14054

which may be of use to you.

Go to Top of Page

KHeon
Posting Yak Master

135 Posts

Posted - 2002-04-23 : 07:38:45
Good morning everyone (well, it's morning for me).

I've just finished building a set of DTS packages for a client that periodically scans a directory for files. The file names and extensions are meaningless to the package because they all follow the same file structure. Using VBScript I create a Folder object and then a Files collection. Looping through the collection I then process every file that exists in the directory, one at a time.

This is done using SQL2000 and I make use of the Dynamic Properties Task I'm able to, on the fly, change the import datasource (ie: the import text file). This process is broken down into multiple packages, the first one creates the Files collection, creates an object instance of another package (which has global variables) and as I loop through the Files collection I modify the global variables in the secondary package, which then processes the new file.

Again, this requires that all the files are in the same format or it will break. Additionally, to make working on the package easier I create a "template" import file that is hardcoded as the "source" so that when I work on the package and need to dive into the transformations section I don't get an error about "File Not Found".

Hope this helps.

PS: For more assistance, I recommend the following book: Professional SQL Server 2000 DTS from Wrox. ISBN: 1-861004-41-9 as they cover the new features of DTS 2000 fairly well.

Kyle Heon
PixelMEDIA, Inc.
Programmer L2
kheon@pixelmedia.com
Go to Top of Page

TheMilkMan
Starting Member

10 Posts

Posted - 2002-04-23 : 07:56:13
yes, all files are of the same structure, only difference is the name of the file.

Thanks for the help.

// SlowlyGetting There //
Go to Top of Page
   

- Advertisement -