Partilhar via


How to: Modify a SQL Server Agent master Job (Transact-SQL)

This topic describes how to use stored procedures to modify a Microsoft SQL Server Agent master job.

To change the scheduling details for a job definition

  1. Execute sp_update_schedule.

To add, change, or remove steps from a job

  1. Execute sp_add_jobstep to add new job steps.

  2. Execute sp_update_jobstep to change pre-existing job steps.

  3. Execute sp_delete_jobstep to delete a pre-existing job.

To modify the target server(s) associated with a job

  1. Execute sp_delete_jobserver to delete a server currently associated with a job.

  2. Execute sp_add_jobserver to associate a server with the current job.

Note

A SQL Server Agent master job cannot be targeted at both local and remote servers.

See Also

Concepts

Creating Jobs

Other Resources

System Stored Procedures (Transact-SQL)
sp_add_job (Transact-SQL)
sp_add_jobstep (Transact-SQL)
sp_add_schedule (Transact-SQL)
sp_attach_schedule (Transact-SQL)
sp_add_jobserver (Transact-SQL)
sp_delete_jobserver (Transact-SQL)
sp_update_schedule (Transact-SQL)
sp_update_jobstep (Transact-SQL)
sp_delete_jobstep (Transact-SQL)

Help and Information

Getting SQL Server 2005 Assistance