I have a SQL Server Agent job that calls an SSIS package.
The first task of the SSIS package is a C# script that checks for the existence of a file in a folder.
The file may or may not exist in the folder.
If the file exists the task completes successfully and the next task in the package is invoked.
The job retries a number of times before terminating.
The issue I have is that if the file does not exist , when the job finishes it writes an entry in the History Log that the “Job Failed”.
The job is scheduled to run every day, but the file will appear only once a month, and which day that happens is unknown.
So I end up with a History Log with job fail entries every day except once a month.
As far as I am concerned , the job is a success if it runs, if no file exists, that is not a failure in this context.
So I do not want a job failure written to the History Log of the job.
I still want the job the package to terminate at the first task if a file is not found, but I do not want fail to be written to the History Log of the Job.
I have included the c# script.
Is there some amendment to this script I can make to achieve this?
Or is there some other way?
I have checked out the recommendations at these locations below but without success.
Any guidance appreciated