If the file isnt there on ftp server generate error by using SSIS

SSIS package has to load the data from flat file on ftp server.The package is scheduled  to execute Quarterly using sql  Server agent .
If the file isnt there on ftp server how can i Fail the job .Keep retrying until file arrives
LVL 1
coventriAsked:
Who is Participating?
 
PedroCGDConnect With a Mentor Commented:
COventri,
 the option Failure is one property of DTS Result.
Check the last line of code... where you can set to sucess as I made in the script, or set as a failure.
As I told you, you have several alternatives, let me know if you have some doubts.
Regards,
Pedro
0
 
PedroCGDCommented:
Dear Friend,
I made a simple SSIS package for you.
Create a new SSIS Project, add the attached package (rename it to dtsx).
Update the flatfile connection and join an see results.
Inside script you can use warning or error events.
Try to delete or rename the text file to test the package.
Helped?
regards
Pedro

www.pedrocgd.blogspot.com
Package-EE49-dtsx.txt
BudgetEx.txt
FileFound.JPG
0
 
HoggZillaCommented:
Hi coventri,
Your goal, if the file is not there, is to fail the SSA job. To accomplish this in SSIS you can simply create a Script Task that has a result of Failure. See below.
You can evaluate conditions in your Script Task to determine if you want to fail or continue. Like checking the value of a variable.
Make sure your SSIS package property, MaximumErrorCount is set to 1. In the Control Flow window, click in the open space and then open the properties tab.

script-task-failure.bmp
0
 
coventriAuthor Commented:
Hi  HoggZilla/PedroCGD,
Ur code helped me a lot .Its resolved my problem

Thanks and Regards,
coventri
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.