dbTalk Databases Forums  

Processing multiple source files into single destination table..

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


Discuss Processing multiple source files into single destination table.. in the microsoft.public.sqlserver.dts forum.



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

Default Processing multiple source files into single destination table.. - 03-21-2005 , 03:01 PM







There must be some way to loop through all the files within a given folder
and load / transform them into a single DB table....

can anyone suggest a solution using DTS or do I really have to code all this?

--
Michael Calvin

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

Default Re: Processing multiple source files into single destination table.. - 03-21-2005 , 03:26 PM






Yep

I would look at this article

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

Allan


"Michael C" <MichaelC (AT) discussions (DOT) microsoft.com> wrote


Quote:
There must be some way to loop through all the files within a given folder
and load / transform them into a single DB table....

can anyone suggest a solution using DTS or do I really have to code all this?

--
Michael Calvin


Reply With Quote
  #3  
Old   
Simon Worth
 
Posts: n/a

Default Re: Processing multiple source files into single destination table.. - 03-21-2005 , 03:28 PM



You can use an fso object within an activeX script in DTS to get a
listing of all files in a folder. Then loop through each file and
import it.
Usually I set up the fso to get a listing, then loop through each file,
calling dtsrun with the filename as a global variable to import that
particular file. You can call a data pump task within the same dts
package, but I use dtsrun to split it out so that other developers can
follow along easier (if their not that familiar with dts).
Obviously you'll have to do any checks to the filename and contents etc
if there are different files within the folder - you don't want to break
any transformations that you've defined.

Simon Worth

Michael C wrote:
Quote:
There must be some way to loop through all the files within a given folder
and load / transform them into a single DB table....

can anyone suggest a solution using DTS or do I really have to code all this?


Reply With Quote
  #4  
Old   
Simon Worth
 
Posts: n/a

Default Re: Processing multiple source files into single destination table.. - 03-21-2005 , 03:42 PM



I was actually waiting for you to reply to that Allan, then thought, "ah
heck, why not?".
Then, you replied before I hit send!


Simon Worth

Allan Mitchell wrote:
Quote:
Yep

I would look at this article

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

Allan


"Michael C" <MichaelC (AT) discussions (DOT) microsoft.com> wrote in message
news:MichaelC (AT) discussions (DOT) microsoft.com:

There must be some way to loop through all the files within a given
folder
and load / transform them into a single DB table....

can anyone suggest a solution using DTS or do I really have to code
all this?

--
Michael Calvin



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

Default Re: Processing multiple source files into single destination table.. - 03-21-2005 , 04:06 PM



No problems. Different approaches to the same problem is good for provoking thought.


--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote

Quote:
I was actually waiting for you to reply to that Allan, then thought, "ah heck, why not?".
Then, you replied before I hit send!


Simon Worth

Allan Mitchell wrote:
Yep

I would look at this article

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

Allan


"Michael C" <MichaelC (AT) discussions (DOT) microsoft.com> wrote


There must be some way to loop through all the files within a given folder
and load / transform them into a single DB table....

can anyone suggest a solution using DTS or do I really have to code all this?

--
Michael Calvin




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.