Sunday 10 July 2016

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

No comments:

Post a Comment

SqlDataBaseLibrary

using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using AOS.Repository.Infrastructure; using S...