locked
how to send a mail if anyone of the file exists in the folder with attachement using ssis RRS feed

  • Question

  • Hi,

    I have requirement like there are two pdf files in a folder,the req is as below:

    1.I have to check whether the two  files exists in the the folder or not if any one file doesn't exist then I have to send a mail that particular file doesn't exist.

    2.Now,I have to send mail with attachment of file exist,if one file exist then we should able to send with that file and if both the files exist then we should send mail with two attachements.

    Can anyone help on this ,as this is urgent req.

    Early response will be great!!!


    sudha

    Tuesday, June 4, 2013 5:27 AM

Answers

  • Have three send mail tasks, one for each case, and then you can set a variable inside a script task based on what files were found using .net code (that will check for what file exists, e.g.

    Computer.FileSystem.FileExists("c://Check.txt")

    To branch the execution you can use cascading precedence constraints:

    https://www.simple-talk.com/sql/ssis/working-with-precedence-constraints-in-sql-server-integration-services/


    Arthur My Blog

    • Proposed as answer by Mike Yin Friday, June 7, 2013 3:31 AM
    • Marked as answer by Mike Yin Thursday, June 13, 2013 9:58 AM
    Wednesday, June 5, 2013 2:58 AM