February 29, 2008 at 1:26 pm
Is there any way to run a Package in a job and have the destination file change its name with every time the job runs? I really want it to have a date in the name but I would be satisfied If I could at least number the files.
February 29, 2008 at 5:43 pm
under expression for the Destination Property to...
[User::DestinationPath] & "FileName " & (DT_STR,50,1252) GetDate() & ".txt"
This would create something similary
[User::DestinationPath] = "C:\MyFolder\"
Resulting String would be this...
"C:\MyFolder\FileName 2/29/08 15:00pm.txt
March 3, 2008 at 11:51 am
When you say user destination to you mean in the Flat File Connection Manager? Or isthere somewhere else? I tried typing it in there and it doesn't work.
March 3, 2008 at 11:58 am
Create a variable for the path and use get date functions. Click the connection manager for the output text file --> View the properites --> expand "Expressions" --> choose connection string and modifiy the connection string as follows:
Note: @[User::SharePath] is a variable that holds the path.
@[User::SharePath] +
RIGHT("0" + (DT_STR,4,1252) DatePart("yyyy",getdate()),4)+
Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +
Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2) + ".xls"
March 3, 2008 at 12:07 pm
Where do I create the variable?
March 3, 2008 at 12:17 pm
Never Mind. I figured it out and that worked.
Thank You so Much
March 3, 2008 at 12:24 pm
So I can create the destination but when I run the package it tells me the destination does not exist? Normally I don't have to have the file created prior? Am I doing something wrong? Obviously I am new to this. I normally just use this for importing and exporting data.
March 3, 2008 at 12:42 pm
So I can create the destination but when I run the package it tells me the destination does not exist? Normally I don't have to have the file created prior? Am I doing something wrong? Obviously I am new to this. I normally just use this for importing and exporting data.
No, the file does not have to exist before running the package. The destination file is set to overwrite by default. Make sure you configured the destitination connection string expression and not the source connection string expression.
March 3, 2008 at 12:44 pm
You can evaluate your connection string in the expression editor. Just click the evaluate button and make sure it is pointing where you want it to.
March 3, 2008 at 1:00 pm
Thanks for your help. I figured out why it wasn't working.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply