ssismsbi

how to send file in a specific folder in ssis by script task


i want to use script task in ssis to send file in a specific folder after processing how can i do it ? Thank u


Solution

  • Moving the file shouldn't be a problem. Take a look at this. You can pass in the path of files as variables.

        using System.IO;
        string path = (string)Dts.Variables["User::path1"].Value;;
        string path2 = (string)Dts.Variables["User::path2"].Value;;
        try 
        {
    
            // Ensure that the target does not exist.
            if (File.Exists(path2)) 
            File.Delete(path2);
    
            // Move the file.
            File.Move(path, path2);
    
        }