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 2012 Forums
 SSIS and Import/Export (2012)
 Urgent Help Plz

Author  Topic 

tooba
Posting Yak Master

224 Posts

Posted - 2013-05-06 : 12:21:50
Guys,

I really appreciate if some one can guide me,

Here is the thing,
From one folder i am gonna read all .txt file and put in SQL Table. Once this done. Two steps.
1) Move all files in Archive and Rename it with a GETDATE() E.G file name was = text1.txt Rename it to = text1_05062013.txt

2) Once Transfer the data into SQL Table rename the same file in same folder to E.G file name was = text1.txt Rename it to = text1_05062013.txt

Here is my solution for.

1) For each Loop Container
2) Data Flow task inside For each Loop Container
3) File System Task.

I got first and second step, i am stuck in third step. Any help would be great appreciate....

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-07 : 00:24:43
you can use rename file option in the File System Task. Then for the destination property map it to a variable. The variable will have eveluate as expression property to true and the expression set would be as below

@[User::FileName] + "_" + (DT_WSTR,20)(DT_DBDATE)[@System::StartTime]


FileName is variable used inside foreachloop which will get name of the file during each iteration inside the loop
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -