I have been tasked to write a query the checks the status of a SQL server agent job every 10 seconds and return a status code of 1 to control m (Job scheduler program) if the job succeeded or completed and 0 if the job failed.
Has anyone written a script or stored proc that accomplishes such a taks? i attempted to write a script but I get confused the more I look at it?
If you have any script or stored proc or pointers, please share with me.