How to stop a sql job after certain time of execution?

  • How to stop a sql job after certain time of execution? We want to make sure it does not run for ever.

    Environment: SQL2K5 EE 64BIT on 2K3

    Thanks in advance

  • Set another job which periodically will query sysjobs and sysjobhistory in msdb system database. You can check run_status, _time, _duration.

    To stop the job you can use sp_stop_job 'job_name'

  • Thanks Mark

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply