Groups | Blog | Home
all groups > sql server dts > march 2005 >

sql server dts : Processing multiple source files into single destination table..


Michael C
3/21/2005 1:01:04 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?

--
Simon Worth
3/21/2005 2:28:49 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

[quoted text, click to view]
Simon Worth
3/21/2005 2:42:13 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

[quoted text, click to view]
Allan Mitchell
3/21/2005 9:26:02 PM
Yep

I would look at this article

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

Allan


[quoted text, click to view]
Allan Mitchell
3/21/2005 10:06:50 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


[quoted text, click to view]

AddThis Social Bookmark Button