none
How to execute package when both the folder has files in it? RRS feed

  • Question

  • I am working on a SSIS package, In which my package is always running on the server even if the folder has no files in it. I just want to only execute my package when it has files in both the folders the foreach loops are looking at.

    If the folders are empty the package shouldn't be executed.

    Thanks,

    Minhal

    Thursday, October 10, 2019 1:00 PM

Answers

  • It was a different question, as in that case I was looking to run a specific task when the file exists in the specified folder. But now I am looking to execute the whole package when the files exist.

    Hi Minhal,

    Why not to create a new SSIS package with Foreach Loop Task. That task will check for the file(s) existence.

    And put inside of it SSIS Execute Package Task to execute your initial SSIS package.

    Thursday, October 10, 2019 3:57 PM
  • Hi Minhal,

    Just as Yitzhak says, we could use two foreach loop containers by embedding one into another.

    So, it will execute package when both the folders have files.

    Please refer to the following links:

     

    Best Regards,

    Mona


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Friday, October 11, 2019 3:01 AM

All replies

  • Hi there,

    Wasn't it answered there just recently?


    Arthur

    MyBlog


    Twitter

    Thursday, October 10, 2019 2:14 PM
    Moderator
  • Hi Arthur,

    It was a different question, as in that case I was looking to run a specific task when the file exists in the specified folder. But now I am looking to execute the whole package when the files exist.

    Thanks,

    Minhal

    Thursday, October 10, 2019 2:19 PM
  • Then you should not provide with the package design as the whole package must not run.

    You need to use power shell to see if the file is there or a custom program that starts the package if the file is found.


    Arthur

    MyBlog


    Twitter

    Thursday, October 10, 2019 3:48 PM
    Moderator
  • Then you should not provide with the package design as the whole package must not run.

    You need to use power shell to see if the file is there or a custom program that starts the package if the file is found.


    Arthur

    MyBlog


    Twitter

    Hi Arhur,

    That's what I am trying to do. But unable to do so. Can you please provide with any examples, that would be great.

    Thanks,

    Minhal

    Thursday, October 10, 2019 3:49 PM
  • It was a different question, as in that case I was looking to run a specific task when the file exists in the specified folder. But now I am looking to execute the whole package when the files exist.

    Hi Minhal,

    Why not to create a new SSIS package with Foreach Loop Task. That task will check for the file(s) existence.

    And put inside of it SSIS Execute Package Task to execute your initial SSIS package.

    Thursday, October 10, 2019 3:57 PM
  • Hi Minhal,

    Just as Yitzhak says, we could use two foreach loop containers by embedding one into another.

    So, it will execute package when both the folders have files.

    Please refer to the following links:

     

    Best Regards,

    Mona


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Friday, October 11, 2019 3:01 AM
  • Hi Yitzhak,

    Yeah it worked for me.

    Thanks,

    Minhal

    Friday, October 11, 2019 4:23 PM
  • Hi Mona,

    Yes it did, worked for me.

    Thanks,

    Minhal

    Friday, October 11, 2019 4:23 PM