3

Using SQL Server 2008/R2 Maintenance Plans to setup some automated backups/cleanups and notifications. One thing that I can't figure out is what is the difference between Success and Completion?

The way I think about it, is that completion doesn't care if the job failed or succeeded, but if it failed, then obviously it didn't complete maybe??

Perhaps its left there in case of scripts where there might not be a way to tell what the actual outcome was, just that the script completed, but this still feels like its the same as success and failed.

I couldn't find much documentation for it either.

2 Answers 2

5

The execution result, in your case, success, completion, or failure is a precedence link that can create a relationship between two tasks. From BOL

A precedence link between two tasks establishes a relationship between the tasks. The second task (the dependent task) executes only if the execution result of the first task (the precedent task) matches specified criteria. Typically the execution result specified is Success, Failure, or Completion

If you wanted to say, have your plan execute a statement that was not designed around success or failure you could use completion to establish a relationship and proceed to the next task.

Example: Purge all records of type 'A' from database [ABC], then execute a database backup - You don't care how many records, if any, were found or deleted. Just run the statement. When it is done, back up the database

Example: Reorganize the index's of database [ABC] only after successfully checking the integrity. If the integrity check fails, do not reorganize the index's

Maint. Plans

Precedence Constraints

5
  • Failure: When there is some issue in job execution.
  • Success: When the job executed successfully.
  • Completion: This will contain the completion of SQL job whether it completes successfully or with issues....

SQL JOB can be mapped with database mail service for e-mail notifications. These mails will contain the information about success/failure of SQL job.

If any issue occurred in job execution, Job history can be viewed for the root cause of error.....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.