Jump to content

Hi community, I am trying to figure if its possible to cont...


Martin Yergeau

Recommended Posts

Hi community,

I am trying to figure if its possible to control the execution of a RC post-procedure and if so, how

I know how to pass parameters to RC pre/post-procedure but my goal is to avoid execution of a post-procedure if the associated RC task as failed for any reason.

It seems that even if the task failed, the post-procedures are always executed.

Thanks

Link to comment
Share on other sites

Hi Martin

This is just an idea but you could read the botsched table for the schedule and check the LASTEXTSTATUS field for the value of FAILURE and if it is that bypass the rest of the code in the post execution procedure. I have not tried it so Im not sure if that is updated before the post execution procedure starts.

Link to comment
Share on other sites

Hi Chuck,

Still have to perform some test to be sure hat I will manage all cases, but seems to work.

However, since my post-procedure is a common one that is used in several schedules, I have to use the below to retrieve the proper last execution status according to executed schedule:

SQL SQLMSS PREPARE SQLOUT FOR

SELECT LASTEXSTATUS

FROM [dbo].[bOTSCHED]

WHERE JOBDESC = '&DSTSCHEDDESC.EVAL'

Thanks

Link to comment
Share on other sites

Finally, this technique seems to work when testing BOTSCHED.LASTEXSTATUS in a post procedure but doesnt if its a step within the task it self because it does read before its actually updated.

Which make sense.

It reads, the previous execution and not the current one.

So you have to pay attention when using that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...