SSIS Problem

  • Hi all,

    I have package that has for each loop. and i am passing files(excel) to provess and get data to database. all the process works fine. but when there is no excel file it fails. but i want to set it to exit out successfully when package finds no excel file in the folder.

    how can i do that.

    Please guide!!

    thanks

    pat

  • Is it a For Each loop from a list, or a For Each File loop? A For Each File loop will exit gracefully if there are no files. A For Each loop will need to have a check at the beginning of the loop to see if the file exists (this can be done through a script object pretty easily). If it doesn't find the file, it goes onto one execution path (possibly a simple exit, possibly a complete exit of the loop), if it does find a file, it goes onto a different path that does stuff with the file.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • it's a for each look container in SSIS package. and i passed variable (fn) for filename to property of varaible mapping. and in general i passed the locatoin of the file (//name/filelocation) and in file exetenstion i passed *.xls.

  • also it is for each file enumerator.

  • I'm not clear on what you just wrote. Sorry, just can't understand it. Maybe someone else can.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • If you are using a Foreach Loop Container then the package should not fail if there are no files.

    I just tested it to be sure.

    What Is the actual error you are seeing in Execution Results?

Viewing 6 posts - 1 through 5 (of 5 total)

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