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

File System task fails with the errror message Expand / Collapse
Author
Message
Posted Thursday, July 18, 2013 1:29 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, October 22, 2013 2:21 PM
Points: 55, Visits: 526
I have an ssis package which loads excel file into Sql server...After all the processing is done i am renaming the file(with timestamp) and moving into another folder...It's failing while renaming the folder(if i just move the file without renaming it works file)

Here is the expression i am using for creating Destination variable

@[User::DestinationDirectory] +"\\"+ @[User::FileName]+"."+@[User::DateTime] +".xls"

Variable DestinationDirectory has the folder location, FileName contains original fileName,
Datetime variable has time stamp(something like 20130718122654)

Here is the error message i got (Could not find a part of the path)

If i don't specify filename and datetime i can move the file without any problem....


Post #1475191
Posted Thursday, July 18, 2013 1:50 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 1:56 PM
Points: 242, Visits: 1,315
Casting is your friend here. Not all parts of that string you are concatting are of the same type. Make sure all elements are of the same type and using the same codepage.
Post #1475205
Posted Thursday, July 18, 2013 1:53 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, October 22, 2013 2:21 PM
Points: 55, Visits: 526
Not sure whether it's a casting issue...I was able to evaluate the expression without any problems
Post #1475206
Posted Thursday, July 18, 2013 4:59 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, October 22, 2013 2:21 PM
Points: 55, Visits: 526
Silly mistake.. Forgot to change the Operation in File System Task to Rename File(It was move file before)

Post #1475237
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse