Export (0) Print
Expand All

Stop a Job

 

This topic describes how to stop a Microsoft SQL Server Agent job. A job is a specified series of actions that SQL Server Agent performs.

  • If a job is currently executing a step of type CmdExec or PowerShell, the process that is being run (for example, MyProgram.exe) is forced to end prematurely. This can cause unpredictable behavior, such as files that are being used by the process being held open.

  • For a multiserver job, a STOP instruction for the job is posted to all target servers of the job.

To stop a job

  1. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.

  2. Expand SQL Server Agent, expand Jobs, right-click the job you want to stop, and then click Stop Job.

  3. If you want to stop multiple jobs, right-click Job Activity Monitor, and then click View Job Activity. In the Job Activity Monitor, select the jobs you want to stop, right-click your selection, and then click Stop Jobs.

Arrow icon used with Back to Top linkUnable to find bookmark 'Top' in topic '{"project_id":"acb1e239-07de-4739-ad90-d32720c7417b","entity_id":"4249328a-24d8-4284-9d1d-7d04ed90e3d7","entity_type":"Article","locale":"en-US"}'. Rebuild topic '{"project_id":"acb1e239-07de-4739-ad90-d32720c7417b","entity_id":"4249328a-24d8-4284-9d1d-7d04ed90e3d7","entity_type":"Article","locale":"en-US"}' may solve the problem.

To stop a job

  1. In Object Explorer, connect to an instance of Database Engine.

  2. On the Standard bar, click New Query.

  3. Copy and paste the following example into the query window and click Execute.

    -- stops a job named Weekly Sales Data Backup
    USE msdb ;
    GO
    
    EXEC dbo.sp_stop_job
        N'Weekly Sales Data Backup' ;
    GO
    

For more information, see sp_stop_job (Transact-SQL).

Arrow icon used with Back to Top linkUnable to find bookmark 'Top' in topic '{"project_id":"acb1e239-07de-4739-ad90-d32720c7417b","entity_id":"4249328a-24d8-4284-9d1d-7d04ed90e3d7","entity_type":"Article","locale":"en-US"}'. Rebuild topic '{"project_id":"acb1e239-07de-4739-ad90-d32720c7417b","entity_id":"4249328a-24d8-4284-9d1d-7d04ed90e3d7","entity_type":"Article","locale":"en-US"}' may solve the problem.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft