dbTalk Databases Forums  

Loop thru files and process each one

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


Discuss Loop thru files and process each one in the microsoft.public.sqlserver.dts forum.



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

Default Loop thru files and process each one - 08-23-2005 , 02:36 AM






Hello...

A customer will be sending me several files each day and I want to try and
write a DTS Package to loop through the files and process each one.

I have figured out how to read through the contents of a folder/directory
and look at each file, but how do I get to the next step and process each
file?

I will need to execute a stored procedure against each file - passing the
file name into the Stored Proc. I can do this for a single file in my DTS
package, but I do not know how to loop through each one, execute my stored
proc task and then exit.

If anyone can help or pass along an article or link, I would appreciate it.

Thanks
- will

Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Loop thru files and process each one - 08-23-2005 , 04:00 AM






This shows looping over files and doing stuff with each one-

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


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"dw" <dw (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello...

A customer will be sending me several files each day and I want to try and
write a DTS Package to loop through the files and process each one.

I have figured out how to read through the contents of a folder/directory
and look at each file, but how do I get to the next step and process each
file?

I will need to execute a stored procedure against each file - passing the
file name into the Stored Proc. I can do this for a single file in my DTS
package, but I do not know how to loop through each one, execute my stored
proc task and then exit.

If anyone can help or pass along an article or link, I would appreciate
it.

Thanks
- will



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

Default Re: Loop thru files and process each one - 08-23-2005 , 10:32 AM



Thanks for the link. This looks like it will do what I want.

- will

"Darren Green" wrote:

Quote:
This shows looping over files and doing stuff with each one-

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


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"dw" <dw (AT) discussions (DOT) microsoft.com> wrote in message
news:A1AA282D-BA62-4A70-B2AF-1956292DBB4D (AT) microsoft (DOT) com...
Hello...

A customer will be sending me several files each day and I want to try and
write a DTS Package to loop through the files and process each one.

I have figured out how to read through the contents of a folder/directory
and look at each file, but how do I get to the next step and process each
file?

I will need to execute a stored procedure against each file - passing the
file name into the Stored Proc. I can do this for a single file in my DTS
package, but I do not know how to loop through each one, execute my stored
proc task and then exit.

If anyone can help or pass along an article or link, I would appreciate
it.

Thanks
- will




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.