none
File System Task Move Directory deletes parent destination folder RRS feed

  • Question

  • I attempted to use Move Directory to move the contents of one directory to another.  I encountered the 'different volume' issue that others have experienced.  While this error is frustrating I can work past this particular issue.  My more pressing question is why is the move directory command overwriting a destination directory?  

    When I setup the Move directory file task I provided two vars to hold src and dest location:

    dest var: \\testserver\output\

    src var: \\devserver\dev\testfiles\

    Set overwrite destination = TRUE

    Why would Move Directory overwrite output folder at destination?  Shouldn't it only overwrite if the testfiles directory exists at destination?  This is very frustrating since I cannot find enough information in the official documentation to understand what is happening here.  

    Is it just me or does the documentation for Move directory seem.....incomplete?  

    Thanks for any assistance!!


    

    Tuesday, March 12, 2013 5:11 PM

Answers

  • By setting your destination location as \\testserver\output\, you are directing SSIS to equate \\..\..\testfiles\ to \\..\output.  If you want it to create a subdirectory, set the destination to \\testserver\output\testfiles\.

    I agree the BOL documentation is lacking for the various file system task options, however there are numerous examples on the interweb outlining SSIS file system task move, or file system task copy/delete.  

    Wednesday, March 13, 2013 7:05 PM

All replies

  • From what I understand, using overwrite actually deletes at the destination, then copies everything over again.  You may want to look at moving the files instead of the folder.
    Tuesday, March 12, 2013 10:33 PM
  • I would expect Overwrite to ...overwrite at the destination but only if the Directory I am moving exists at the destination.  There is nothing in the Ms documentation that states that Overwrite will actually overwrite the parent directory at the destination.  For instance since I was trying to move the directory 'testfiles' to '\\testserver\output\'.  The expected behavior, IMHO, would be to only delete at destination if the directory 'testfiles' existed at destination.  Instead Move with Overwrite actually deleted the directory 'output' at the destination.  

    This may be the expected behavior of the Move command but my contention is the documentation is incorrect and/or incomplete.  My questions still stand...

    1. Why would Move Directory overwrite output folder at destination?  

    2. Shouldn't it only overwrite if the 'testfiles' directory (from my example in my original post) exists at destination? 

    3. Is it just me or does the documentation for Move directory seem.....incomplete?  

    Thanks.

    Wednesday, March 13, 2013 4:58 PM
  • By setting your destination location as \\testserver\output\, you are directing SSIS to equate \\..\..\testfiles\ to \\..\output.  If you want it to create a subdirectory, set the destination to \\testserver\output\testfiles\.

    I agree the BOL documentation is lacking for the various file system task options, however there are numerous examples on the interweb outlining SSIS file system task move, or file system task copy/delete.  

    Wednesday, March 13, 2013 7:05 PM
  • I also stack on this trouble few hours on SSDT-2013, as same as the question.

    Thanks you for answer.


    My Blog : http://tatmingstudio.blogspot.hk/

    Thursday, July 30, 2015 7:04 AM