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

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

tooba
Posting Yak Master

143 Posts

Posted - 05/06/2013 :  12:21:50  Show Profile  Reply with Quote
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

India
52309 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
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs

Edited by - visakh16 on 05/07/2013 00:26:21
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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