FTP Task LocalPath Variable File Name
SQL SSIS 2005 FTP Task. Desired file has date in filename(ie: SFHXXXXXX07252011.txt). I have set FTP Task IsLocalPathVariable to TRUE & created a variable string with this expression: "Z:\\SFHXXXXXX"+ RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" , @[System::StartTime] ), 2) + RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , @[System::StartTime] ), 2) + (DT_STR,4,1252)DATEPART( "yyyy" , @[System::StartTime] ) + ".txt" Result: "not a File" I have created a Connection Manager called "FlatFile FTP" with the same expression assigning connection string, & set FTP Task IsLocalPathVariable to FALSE & selected the connection "FlatFile FTP" ... same result. How do I get this to recognize my file?
July 25th, 2011 7:56am

Z:\SFHXXXXXX07252011.txt Is it a Mapped Drive ???????-------------------------------------------------------- Surender Singh Bhadauria
Free Windows Admin Tool Kit Click here and download it now
July 25th, 2011 8:19am

So, now I tried adding another expression in the Connection to assign the NAME with the same expression...then selected that NAME for the LocalPath connection in the FTPTask... still get result FTP Task: Type of Connection "Z:\SFHXXXXXX07252011.txt" is Not a file. I have verified file's existance & security access 
July 25th, 2011 8:20am

No, local data drive.
Free Windows Admin Tool Kit Click here and download it now
July 25th, 2011 8:26am

Hi, I have done the same thing but in my expression i used two variables one for file Location and other for file name. and my expression was something like : @[User::FileLocation]+"Errors\\"+ (DT_STR, 4, 1252)( YEAR(GETDATE())) +Right("0" +(DT_STR, 2, 1252)( MONTH(GETDATE())),2) +Right("0" +(DT_STR, 2, 1252)( DAY(GETDATE())),2) + Right("0"+(DT_STR, 2, 1252)(DATEPART( "Hour", getdate() ) ),2) + Right("0" +(DT_STR, 2, 1252)(DATEPART( "Minute", getdate() ) ),2)+"_" + @[User::FileName]
July 25th, 2011 10:22am

Even if I create a Variable with a static path for its value (Z:\SFHXXXXXX07252011.txt)... I get "The variable "User::StaticPath" doesn't contain file path(s)." I think I've tried every angle....variable value / expression connection path string / expression connection name same as path string
Free Windows Admin Tool Kit Click here and download it now
July 25th, 2011 10:32am

Soo, you used variable(s) inside the expression?....& your expression was where? on a Connection or on the FTPtask?
July 25th, 2011 10:53am

OK, I tried a variable with a static path assigned again...& it worked. But when I change the variable to one containing an expression...it says "The variable "User::LocalPath" doesn't contain file path(s)" So, if this expression does resolve to the proper string for the path....is the variable not processing the expression? If I can get the variable to work...I should be able to delete the Connection & Task expressions I tried to get to work.
Free Windows Admin Tool Kit Click here and download it now
July 25th, 2011 11:28am

OK, I tried a variable with a static path assigned again...& it worked. But when I change the variable to one containing an expression...it says "The variable "User::LocalPath" doesn't contain file path(s)" So, if this expression does resolve to the proper string for the path....is the variable not processing the expression? If I can get the variable to work...I should be able to delete the Connection & Task expressions I tried to get to work. after assigning to expression set the package property Delay validation -->TRUE and try hope this helps!!!Shailesh Please mark the post as answered if it answers your question.
July 25th, 2011 11:33am

AHA...got it...I'm not telling...na na... Oh, OK stop whining. I found on the Variable Properties page a switch for EVALUATEASEXPRESSION and an field for EXPRESSION...once I set those my variable works. & tested successful after cleaning up the other attempted expressions & Connections
Free Windows Admin Tool Kit Click here and download it now
July 25th, 2011 11:40am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics