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

Can SSIS File System Task handle multiple files with "Move file" Operation? Expand / Collapse
Author
Message
Posted Saturday, July 11, 2009 12:16 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, March 19, 2014 8:47 PM
Points: 55, Visits: 132
I have a File System Task which uses a SourceVariable to set source files.

My SourceVariable was passed from previous steps and contains something like "C:\Temp\File01*.*".

I intend to move all files started with prefix "File01" to be moved to destination directory.

However, I got the following error:
[File System Task] Error: An error occurred with the following error message: "Illegal characters in path.".

It's complaining about the * in my path. However, I don't know the filenames beforehand. Is there anyway to get around it?
Post #751532
Posted Saturday, July 11, 2009 2:13 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, July 21, 2014 11:49 PM
Points: 4,973, Visits: 11,660
You could try a FOREACH container - put your File System Task in it and it should move all of the matching files one by one - after just a little bit of config.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #751535
Posted Saturday, July 11, 2009 10:12 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, March 19, 2014 8:47 PM
Points: 55, Visits: 132
Thanks for the suggestion! Would you please elaborate a little more?

I couldn't figure out how to set the "Enumerator configuration" in the Foreach Loop (Foreach File Enumerator) container using variables. How can I pass my directory variable (C:\Temp) and File variable (File01*.*) to Folder and Files fields respectively?
Post #751618
Posted Saturday, July 11, 2009 11:11 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, July 21, 2014 11:49 PM
Points: 4,973, Visits: 11,660
Sure thing. Edit the Foreach container, click on Collection, select Expressions and set the Directory and Filespec properties to retrieve the contents of your variables.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #751627
Posted Saturday, July 11, 2009 11:33 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, March 19, 2014 8:47 PM
Points: 55, Visits: 132
Got it. Thanks a lot, Phil!
Post #751668
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse