May 20, 2010 at 9:59 am
I am running a job to run a stored procedure from OLEDB Source and then save the output to a flat file destination.
The problem is every time the job runs i have an option to overwrite the data or append the data.
If there a way that every time the job runs a new file is created with the (file name + date run).
May 20, 2010 at 10:08 am
Easiest solution is to leave the destination file static, but put a File System or Script task at the end of the job which does a file copy for you, to a file with a dynamic name - there are examples all over this forum of how to do that.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
May 20, 2010 at 10:16 am
Thanks for the prompt reply Phil, could you guide me to a post where this is covered also how do i make the destination file static?
May 20, 2010 at 10:39 am
By 'static', I was referring to the file name, not the contents of the file. Unless you have done anything fancy, this will already be the case - the destination file name, as reference by an SSIS destination connector, will always be the same (output.csv, or whatever).
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
May 20, 2010 at 10:43 am
Hi Phil,
This is what i am doing
On the Connection Manager for the Flat File Destination - In the
Properties page, expand Expressions and create a new Expression for
ConnectionString. Set the Expression to be like the following:
"filename" + (DT_STR, 8, 1252)(YEAR(GETDATE()) * 10000 +
MONTH(GETDATE()) * 100 + DAY(GETDATE())) + ".csv"
Now this appends the file name as i can see in the output, but now i need to upload them to a ftp.
In the ftp task as when i set the set "IsLocalPathVariable" to
true - but then what should I put in the local path? I suspect that
is my issue.
May 21, 2010 at 11:08 am
Hello,
The expression is working and everytime i run the data flow i do see a new file come up with the current date. Now i have placed this data flow task in the foreach loop container and its supposed to pick up the latest file, however it picks up the old file.
Is there any solution for this?
May 23, 2010 at 10:57 pm
Hithere
not sure if u have tried this, but have you tried adding the time of creation to pick up the recent one
May 25, 2010 at 2:29 am
chaudharyabhijit (5/21/2010)
Hello,The expression is working and everytime i run the data flow i do see a new file come up with the current date. Now i have placed this data flow task in the foreach loop container and its supposed to pick up the latest file, however it picks up the old file.
Is there any solution for this?
How did you configure the for each loop container and the data flow task to pick up the most recent file?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
May 26, 2010 at 11:37 am
I added a variable for the file path and called it in the for each loop container.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply