SSIS,file Exist and Package Exit

  • ok

    do you have an SSIS example code that i can download and learn from how to do it?

  • I'd probably do it all in a Script Task. I'm not a big fan of sticking in Script Tasks to increment variables and stuff.

  • Hi,

    I think one of the earlier posters may have mentioned this already.

    Use a For Each container to enumerate through the folder. It will execute whatever task is placed within the container each time it finds an item in the enumeration.

    In the case of the file enumerator, it will not execute the task if there are no files that match the filemask. This will prevent the errors you mentioned.

    Therefore the easiest way to achieve what you're after is a for each file enumerator with a file system move task inside it.

    HTH

    Kindest Regards,

    Frank Bazan

  • Peleg,

    I second Alvin's suggestion and have had success with this approach.

    http://rafael-salas.blogspot.com/2007/03/ssis-file-system-task-move-and-rename.html

    Matt

  • Alvin - i have tried out to do the same as :

    http://rafael-salas.blogspot.com/2007/03/ssis-file-system-task-move-and-rename.html

    and i have some problems :

    1)how do i add a variable as you suggested, that will count the number of files that were moved? (where do i put the code for it,and which code?)

    2)i have tried to do as the above code but i get :

    "Could not find a part of the path."

    while i am sure i put all relevent code

    any idea?

    Thanks

    Peleg

  • You could add a script block inside the Foreach container that increments a variable on each pass.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • ok

    and when i drag the green arrow to the next step

    how can i check there if i can go to the next step if for example the value of the variable is more then 1?how do i access the variable from there?

  • From the drop down box select constraint and expression (I hope that's the correct wording)

    In the text box, enter:

    @[your_variable] > 0

    Replace your_variable with the name of your variable.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 8 posts - 16 through 22 (of 22 total)

You must be logged in to reply to this topic. Login to reply