SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


to rename a file by attaching datestamp at the end of filename using SSIS File task


to rename a file by attaching datestamp at the end of filename using SSIS File task

Author
Message
Greg Caporale
Greg Caporale
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 62
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
Tommy Bollhofer
Tommy Bollhofer
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4114 Visits: 3359
NP, Good luck Smile

Tommy

Follow @sqlscribe
Adam Haines
Adam Haines
SSCertifiable
SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)

Group: General Forum Members
Points: 6498 Visits: 3135
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
Greg Caporale
Greg Caporale
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 62
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%?
Adam Haines
Adam Haines
SSCertifiable
SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)

Group: General Forum Members
Points: 6498 Visits: 3135
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
Greg Caporale
Greg Caporale
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 62
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
Adam Haines
Adam Haines
SSCertifiable
SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)

Group: General Forum Members
Points: 6498 Visits: 3135
Sometimes the most simple things are the most difficult. Wink



My blog: http://jahaines.blogspot.com
vik.freak
vik.freak
Valued Member
Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)

Group: General Forum Members
Points: 71 Visits: 77
U might have missed to give value to that variable.
Just check .
Sri8143
Sri8143
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1201 Visits: 2469
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
Tommy Bollhofer
Tommy Bollhofer
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4114 Visits: 3359
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

Follow @sqlscribe
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search