dbTalk Databases Forums  

multiple input files

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss multiple input files in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
GriffithsJ
 
Posts: n/a

Default multiple input files - 01-29-2004 , 07:44 AM






Hi
I have a directory that will have many input files (~10,000), all with
different names but following the same naming convention:

nITEMS.TXT

Where n is an alpha-numeric string of variable length; in other words, all
the filenames will all end with "ITEMS.TXT"

The structure of these files are identical and I wish to go through each
file in turn (order irrelevant) and import the data into my SQLServer
database. The transformation for each file's data will be identical.

If I were to do this for a single file, I'd use a text file source to point
to the text file and a DB connnection object and define the transformation.

What I guess I need to do is have some sort of ActiveX script that loops
through every file in the directory and for each file re-points the
text-file-source object to a different file and run the transformation. Not
sure how to achieve this....

Any suggestions?

Many thanks

Griff



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: multiple input files - 01-29-2004 , 07:58 AM






This will do it for you

Looping, Importing and Archiving
(http://www.sqldts.com/Default.aspx?246)

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"GriffithsJ" <GriffithsJ_520 (AT) hotmail (DOT) com> wrote

Quote:
Hi
I have a directory that will have many input files (~10,000), all with
different names but following the same naming convention:

nITEMS.TXT

Where n is an alpha-numeric string of variable length; in other words, all
the filenames will all end with "ITEMS.TXT"

The structure of these files are identical and I wish to go through each
file in turn (order irrelevant) and import the data into my SQLServer
database. The transformation for each file's data will be identical.

If I were to do this for a single file, I'd use a text file source to
point
to the text file and a DB connnection object and define the
transformation.

What I guess I need to do is have some sort of ActiveX script that loops
through every file in the directory and for each file re-points the
text-file-source object to a different file and run the transformation.
Not
sure how to achieve this....

Any suggestions?

Many thanks

Griff





Reply With Quote
  #3  
Old   
GriffithsJ
 
Posts: n/a

Default Re: multiple input files - 01-29-2004 , 08:01 AM



Quote:
This will do it for you
It certainly appear to!

Many thanks

Griff




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.