

write the value to our global SSIS variableĭts.Variables.Value = fileName ĭts.TaskResult = (int)ScriptResults.Success Since there should be only one file, we will grab the zeroeth this array will catch all the files matching a given patternįoundFiles = System.IO.Directory.GetFiles(inputFolder, fileMask) Success = .DTSExecResult.Success,įailure = .DTSExecResult.Failure Public partial class ScriptMain : .ScriptTask.VSTARTScriptObjectModelBase

Using System.IO // this needs to be added Create a Script Task Component and check InputFolder as a read only variable, FileName as a read/write variable.

This script again assumes you have the variables InputFolder and FileName defined. You can also do this via a script task, if you'd like to see that, let me know. Assuming you have 2 variables called FileName (which is what you will have the value assigned to) and an InputFolder variable that contains the "where" we should be looking ForEach Loop Editor The easiest way would be to set up a Foreach Loop container that has all the "work" of your package inside of it (optionally, you can it as a precursor step and use a conditional expression off of it).
