SSIS: Move a Folder from one Drive to Another Drive Using the File System Task

SSIS: Move a Folder from one Drive to Another Drive Using the File System Task

When I tried to answer the question in this thread - http://social.msdn.microsoft.com/Forums/sqlserver/en-US/cec6c11f-ec2c-48e2-9c14-199c640ebb05/move-folder-using-file-system-task , I came to know about the fact that using File system Task by setting the option Operation  =  Move Directory, we can move a folder only  in the same drive not across different drives. If we try to move between different drives we will end up with the following error:

[File System Task] Error: An error occurred with the following error message:
"Source and destination path must have identical roots. Move will not work across volumes."

So the workaround I suggested to move a folder from one drive to another drive using File System Task is as follows:

Drag-drop two File System Task on the Control Flow, one for copying the folder from one drive to another drive because using File system Task by setting the option Operation  =  Copy Directory we can copy a folder across different drives, and the second one for deleting the folder  by setting the option Operation  =  Delete Directory after copying it to destination drive, hence a folder is moved from one drive to another drive.

Let us consider an example:

I have folder named "Anil" in the path C:\Source (source drive) and the destination path is D:\Destination (destination drive)

Copy Directory - File System Task: (To copy the folder  "Anil" from C:\Source to D:\Destination )





DeleteDirectory - File System Task : (To delete the folder "Anil" from C:\Source )



Connection Managers:
 
[ Copy Directory (File System Task) - Left top image is Destination Connection Manager, Left bottom image is Source  Connection Manager and Right side image  is Connection manager for  DeleteDirectory (File System Task)  ]




Using SSIS - Script task with VB / C# code , we can move a folder from one drive to another drive , but to move a folder from one drive to another drive using File System Task, I guess the above suggestion is the only work around .

Leave a Comment
  • Please add 7 and 2 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Ed Price - MSFT edited Revision 2. Comment: Title and tags

  • Naomi  N edited Revision 1. Comment: Minor change

Page 1 of 1 (2 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Naomi  N edited Revision 1. Comment: Minor change

  • Ed Price - MSFT edited Revision 2. Comment: Title and tags

Page 1 of 1 (2 items)