sqlsql-serversql-server-job

Re-execute SQL Server job in case of failure


Currently I am creating a SQL Server job. My requirement is whenever the job fails, it needs to run one more time. Is it possible in SQL Server?


Solution

  • I'm not sure if this is the best way to do it, but you can configure every single step of a job to re-run a specific number of times after a specific number of minutes (in case of network troubles, for example). Open the step configuration in SQL Server Management Studio and set the "Retry attempts" and "Retry interval (minutes)" according to your preferences.

    Of course, this will not work if you want to re-run the whole job from the beginning and it will not retry infinitely.