'how to check files are arrived in folder or not?
Need to Send list of files name used the SSIS to check the files are arrived in folder or not ? if not then send mail files are not arrived, if arrived then send mail this files arrived into folder with list of files name ?
Solution 1:[1]
here is a quick answer...
Use a script task (with 1 output variable) to get a file list in the folder:
You need to add Namespaces: System.IO; System.Linq;
//Array of file names in a folder
var fileList = new DirectoryInfo([folderPath]).GetFiles().Select(f => f.Name);
//Convert array to run list
string fileListString = string.Join(Environment.NewLine, fileList);
//Load string into variable
Dts.Variables("Your variable Name").Value = fileListString;
Have two paths coming out of script based on length of variable.
if LEN(variable) == 0 then send no file email
if LEN(variable) != 0 then send files received email with variable in the body.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | KeithL |
