• Jeff Moden - Saturday, February 17, 2018 6:04 PM

    SQL-DBA-01 - Thursday, April 23, 2015 9:55 AM

    Can you please suggest all the files from one location to another using the temp table (#FileDetails)?I have a rmeote location where I want to copy all the files from local server to remote share.I have xp_cmdshell offers copy/move features but wanted to know if you have drafted already any other good script, can make use of it.Fianlly great script..

    Ah... talking about a post slipping through the cracks... my apologies.

    Using XP_CmdShell to call ROBOCOPY or even the much older XCOPY would probably do the trick for anyone needing to do such a thing.  Whomever or whatever is running the command simply needs to have privs to the share and you'd use UNCs to identify the target directory/shere.

    Heh... of course, I should also learn to read back up the chain of posts. :blush:

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)