June 29, 2011 at 12:23 pm
I have 10 different File with Diffetent Name.
I want to move that file from download folder to archive folder with current month and Year Information.
How can I move and rename with all 10 different files with Different Names?
LIke
I have acct.txt, trans.txt. acctaddr.txt ...... in download folder.
and I want in archive folder with 06_2011_acct.txt,06_2011_trans.txt ,06_2011_acctaddr.txt.
I want to use only one file system task.......How can i do ?
I have to use for each loop container also?? how ???
Any one can semd me particular link or can explain ....that would be helpful.
Thanks
L
June 29, 2011 at 2:18 pm
If you are looking to do this in SSIS here is a link that will get you started. http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx.
June 29, 2011 at 4:51 pm
THanks for replying me
but I need a specific example.
please any one can provide me Detail.
THanks
June 29, 2011 at 4:59 pm
That example is pretty specific.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
June 29, 2011 at 5:26 pm
As stated you can use SSIS.
An SSIS For Each Loop Container and a Script Task with the File System Object will do it.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
June 30, 2011 at 2:12 am
patla4u (6/29/2011)
I have 10 different File with Diffetent Name.I want to move that file from download folder to archive folder with current month and Year Information.
How can I move and rename with all 10 different files with Different Names?
LIke
I have acct.txt, trans.txt. acctaddr.txt ...... in download folder.
and I want in archive folder with 06_2011_acct.txt,06_2011_trans.txt ,06_2011_acctaddr.txt.
I want to use only one file system task.......How can i do ?
I have to use for each loop container also?? how ???
Any one can semd me particular link or can explain ....that would be helpful.
Thanks
L
June 30, 2011 at 2:16 am
Hi,
This is not possible with Single file system task beacuse move file operation do not include file name thats file you will have to use two file system tasks one for copying the file and another to delete the file.
That is logical as well because moving the file would not be preferable choice in this case.
If you wish I would post you the solution for the same.
Regards
Ashok
June 30, 2011 at 2:17 am
I want to use only one file system task.......How can i do ?
L
This can only be possible with two file system tasks..
June 30, 2011 at 2:25 am
ashok.faridabad1984 (6/30/2011)
I want to use only one file system task.......How can i do ?
L
This can only be possible with two file system tasks..
You are joking right? 🙂
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
June 30, 2011 at 9:02 pm
I am not serious It does not mean I am joking, If you wish to prove mettle, you can share such a solution, I would be grateful to you..
Regards
Ashok
June 30, 2011 at 9:20 pm
Robert klimes (6/29/2011)
If you are looking to do this in SSIS here is a link that will get you started. http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx.
Start by creating an SSIS Package using the example that Bob provided you.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
June 30, 2011 at 9:28 pm
:-D, This is joke of the Day, We should also have a regular post of this kind....
This doest not match anywhere what is the exact requirement.
July 1, 2011 at 9:35 am
Thank for replying me ,..
but you can do it by for each container and file system task ....
Thanks
L
July 1, 2011 at 10:11 am
patla4u (7/1/2011)
Thank for replying me ,..
but you can do it by for each container and file system task ....
Thanks
L
1. Put a ForEach Loop Container
2. Put a File Systeam Task in the ForEach container.
3. Choose "Move file" as the operation in File System Task.
4. DONE
July 1, 2011 at 10:28 am
Welsh Corgi (6/29/2011)
As stated you can use SSIS.An SSIS For Each Loop Container and a Script Task with the File System Object will do it.
Go for it...
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply