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 2008 Forums
 SSIS and Import/Export (2008)
 Load and rename the files

Author  Topic 

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2013-02-27 : 07:35:10
Hi All,

How could i Load the multiple txt files using foreachloop container.
and also I want to renanme file inside the for foreachloop container
after being loaded ..below is my file
mdl_quiz_attempts_11.59.197.4_20130225.txt
to
mdl_quiz_attempts_11.59.197.4_20130225.txt.done ..

Can any one suggest me any idea or link?

Thanks
Vijay Sahu

Vijay is here to learn something from you guys.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-27 : 23:20:52
see logic used here

http://visakhm.blogspot.in/2012/12/selective-file-archiving-using-ssis.html

you just need to change operation inside file system task to rename file and inside append ".move" to loop variable which gets the filename value

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

prett
Posting Yak Master

212 Posts

Posted - 2013-02-27 : 23:21:23
Check this article: http://www.sqlis.com/sqlis/post/Looping-over-files-with-the-Foreach-Loop.aspx

Hope it will work for you!!
Go to Top of Page
   

- Advertisement -