etl2016 - Tuesday, February 6, 2018 3:26 PM
You can control the flow of things like that where you go to the next step on success and then on failure go to some last job step of just a print statement so it shows up in the history. And the second to the last step before that would be on success quit job reporting success, on failure, fail job. So you only get to the last step when your condition check is no go.
That's usually what you see for things with conditional job steps and you can use similar things to skip steps.
You may want to consider two different jobs though. The first job being the condition check, your Go/NoGo in an if statement. if the condition is true, use sp_start_job to start the job that has the steps with the processing. If false, print 'Not okay to run at this date/time'.
That gives you a better idea on when and how often the processing job runs without having to check the specific steps when it's all in one job. And allows the first job to report a failure when it fails outside of your check for Go/NoGo if that's the case (table dropped, login failed, timeouts)
Sue