Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

to rename a file by attaching datestamp at the end of filename using SSIS File task Expand / Collapse
Author
Message
Posted Wednesday, February 27, 2008 11:36 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, February 23, 2012 9:56 AM
Points: 32, Visits: 60
Thanks Tommy, but I must be missing something. When I do as you suggested I get "\Holdings_20080227.csv" in the evaluated expression.
Its almost like my variable "Path" isn't being populated.

Greg
Post #461150
Posted Wednesday, February 27, 2008 12:06 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, July 21, 2014 12:34 PM
Points: 1,157, Visits: 3,255
NP, Good luck :)

Tommy

Post #461188
Posted Wednesday, February 27, 2008 1:48 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 2:10 PM
Points: 2,278, Visits: 3,054
Your variable should look like this: \\myserver\e$\. You should not have to do any fancy manipulation here.
Make sure your variable is a string and in the scope of your current dtsx package. Additionally,
you can select your variable from the variable listing in the expression creator.





My blog: http://jahaines.blogspot.com
Post #461266
Posted Wednesday, February 27, 2008 2:04 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, February 23, 2012 9:56 AM
Points: 32, Visits: 60
Adam,
Thanks for replying. I created the variable "Path" and it is available in the expression creator, but it just doesn't pull in the actual path. In the expression editor it is [User :: Path] (without the spaces) but do I need to define that somewhere else or is that some sort of keyword like the old %windir%?
Post #461278
Posted Wednesday, February 27, 2008 2:16 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 2:10 PM
Points: 2,278, Visits: 3,054
In the expression editor it is [User :: Path]

This means you are using a user variable named Path. Select the variable named Path
from the list and drag it down into the expression editor.

You variable should be written like this: @[User :: Path]. Note the @ sign before the variable.

Once the variable is in the expression editior, click the evalute button to verify the variable.
The results should be the file path you specified. If not you you have your variable configured
incorrectly.




My blog: http://jahaines.blogspot.com
Post #461284
Posted Wednesday, February 27, 2008 2:26 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, February 23, 2012 9:56 AM
Points: 32, Visits: 60
OK, OK, I figured it out...
I am an ID10T!
I created the variable but never gave it a VALUE!!!!

Thanks both of you for your help, I appreciate your quick responses.

Greg
Post #461290
Posted Wednesday, February 27, 2008 2:28 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 2:10 PM
Points: 2,278, Visits: 3,054
Sometimes the most simple things are the most difficult. ;)



My blog: http://jahaines.blogspot.com
Post #461293
Posted Wednesday, February 27, 2008 9:32 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, August 24, 2010 1:19 PM
Points: 11, Visits: 77
U might have missed to give value to that variable.
Just check .
Post #461402
Posted Monday, March 3, 2008 8:10 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 8:33 PM
Points: 384, Visits: 2,325
hey greg and adamm i have a ques its simple though ....

what is the use of "0 " in that when i tried to execute

right ("0"+ (dt_str,4,1252)right--------

it says invalid column 0...actually y do we use 0 over there nad what is the need of using dt_str ,4,1252 i tried without using that for a select statement it wrks

select right(datepart("yyyy",getdate()),4)

2008 is the o/p

whats the use of that n y we should use zero n y is it saying invalid column 0...plz let me know thkz in adavance...


Thanks,
Chinna

Its the Journey which gives you Happiness not the Destination-- Dan Millman
Post #463159
Posted Monday, March 3, 2008 8:17 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, July 21, 2014 12:34 PM
Points: 1,157, Visits: 3,255
If you look at Adam's example, he's using a RIGHT function in conjuction w/ the leading zero to format the date.

@[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) + ".txt"

i.e.

20080301 vs. 200831



Tommy

Post #463164
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse