Rediģēt

Kopīgot, izmantojot


View or Modify Jobs

Applies to: SQL Server Azure SQL Managed Instance

Important

On Azure SQL Managed Instance, most, but not all SQL Server Agent features are currently supported. See Azure SQL Managed Instance T-SQL differences from SQL Server for details.

You can view any job you have created. After you have run a job, you can also view its history. Viewing a job's history allows you to see when the job ran, the status of the job as a whole, and the status of each job step in the job. You can see whether the job ever failed in the past, when the job last completed successfully, and what output the job created each time the job ran. Members of the sysadmin fixed server role can view or modify any job, regardless of the owner.

Note

A job must have been executed at least one time for there to be a job history. You can limit the total size of the job history log and the size per job.

Finally, you can modify a job to meet new requirements. You can modify:

  • Response options

  • Schedules

  • Job steps

  • Ownership

  • Job category

  • Target servers (multiserver jobs only)

To make sure that changes to multiserver jobs take effect, you must post the changes to the download list so that target servers can download the updated job. To ensure that target servers have the most current job definitions, post an INSERT instruction after you update the multiserver job as follows:

EXECUTE sp_post_msx_operation 'INSERT', 'JOB', '<job id>'  

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

Members of the sysadmin fixed server role can view the definition or history of any job, and can modify any job.

Description Topic
Describes how to view Microsoft SQL Server Agent jobs. View a Job
Describes how to view the Microsoft SQL Server Agent job history log. View the Job History
Describes how to delete the contents of the Microsoft SQL Server Agent job history log. Clear the Job History Log
Describes how to set size limits for Microsoft SQL Server Agent job history logs. Resize the Job History Log
Describes how to change the properties of Microsoft SQL Server Agent jobs. Modify a Job

See Also

sysjobhistory