Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 Urgent Help Plz
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

224 Posts

Posted - 05/06/2013 :  12:21:50  Show Profile  Reply with Quote

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....

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 05/07/2013 :  00:24:43  Show Profile  Reply with Quote
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

Edited by - visakh16 on 05/07/2013 00:26:21
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000