Hi,
I have created a job in SQL Server 2005 in which one of the step executes a .NET console application which is created in .NET to update some status to database before the next step. i need some help in sending some status back to sql job when i come accross any problem in the console application for ex when there is a exception i need to send some status to the job, so the job gets failed permanently. i tried few other methods of updating some temporary status database with this error information and have another intermediate step in the job to check for the status... it worked but i dont like doing it. please let me know if there is any other method to do this.
Thanks in advance
Hariharan
Are you doing anything with SSIS, or is this a SQL Server Agent question only?|||I'ts in SSIS as one of the step.|||
Hari Haran wrote:
I'ts in SSIS as one of the step.
Please provide more details then... As it reads, it sounds like it has nothing to do with SSIS.
Thanks,
Phil|||
To make the to step fail, just ensure the applicaton returns a suitable exit code. Take a closer look at the Job Step dialog and note of the "Process exit code of a successful cvommand:" option. Match this to you exist code as required. If this is the SSIS task after all, then look at the properties SuccessValue and FailTaskIfRetrnCodeIsNotSuccessValue.
You have set an exit code? If not see -
Environment.Exit Method (System)
(http://msdn2.microsoft.com/en-us/library/system.environment.exit.aspx)
No comments:
Post a Comment