Lets see if I can explain how to rename a files using the File System Task in BIDS or SSIS.
First you will need to add a File System Task to your Control Flow. (Drag and Drop it to the Form)
Open the task and change the Opertaion to Rename File. Set the IsDestinationPathVariable to True and set the IsSourcePathVariable to True as well.
Click SourceVariable and select from the drop down. Change Name to VSource or any name you want to use to describe your variable. NameSpace should be set to User and the Type in this case should be String. In the Value Field add the path to your file you want to rename here.
Your file source has now been configured. Simple eh! Now Lets configure the destination, this the point where we will actually rename the file.
Click DestinationVariable and select from the drop down. Change Name to VDestination or any name you want to use to descrive your variable. NameSpace should be set to User and the Type in this case shoud be String.
Now that you have setup both variables it time to configure our destination variable. So navigate to the Package Explorer, Select the Variables folder and your variable from the list. In this case VDestination. Change EvaluateAsExpression to True. Select the Expression Field and it will bring up the Expression Builder. You can now build your expression.
Lets take a closer look at the one that I’ve built
\\\\Server\\Folder\\AnotherFolder+ REPLACE ((DT_WSTR, 29)(GETDATE()), ":", ".") + ".csv"
I’ve hard coded the file name. I could have used the VSource Variable and parsed the message using some form of Magic.
I used the GETDATE Function to get the current DateTime from the system.
I then used the DT_WSTR function to convert the the GETDATE value to a string.
I used the REPLACE function to remove the Semi Colons from the GETDate String