Move Folder One Drive To Other Drive Using Sql

       DECLARE @ToDirectory VARCHAR(500)
        SET @ToDirectory ="C:\FolderName"

        DECLARE @FromDirectory VARCHAR(500)
        SET @FromDirectory = "D:\"

        DECLARE @CopyFromToQuery VARCHAR(500)
        SET @CopyFromToQuery ='robocopy  '+@FromDirectory + ' ' + @ToDirectory   + ' /E /MOVE'

        PRINT @CopyFromToQuery
       
        EXEC master..xp_cmdshell @CopyFromToQuery

Post a Comment

0 Comments