sp_add_jobschedule
spaddjobschedule creates a schedule for a SQL Server Agent job.
What changes
- Input
- Not stated in the Microsoft summary.
- Output or change
- Not stated in the Microsoft summary.
Syntax at a glance
dbo.sp_add_jobschedule
{ [ @job_id = ] 'job_id'
| [ @job_name = ] N'job_name' }
, [ @name = ] N'name'
[ , [ @enabled = ] enabled ]
[ , [ @freq_type = ] freq_type ]
[ , [ @freq_interval = ] freq_interval ]
[ , [ @freq_subday_type = ] freq_subday_type ]
[ , [ @freq_subday_interval = ] freq_subday_interval ]
[ , [ @freq_relative_interval = ] freq_relative_interval ]
[ , [ @freq_recurrence_factor = ] freq_recurrence_factor ]
[ , [ @active_start_date = ] active_start_date ]
[ , [ @active_end_date = ] active_end_date ]
[ , [ @active_start_time = ] active_start_time ]
[ , [ @active_end_time = ] active_end_time ]
[ , [ @schedule_id = ] schedule_id OUTPUT ]
[ , [ @automatic_post = ] automatic_post ]
[ , [ @schedule_uid = ] 'schedule_uid' OUTPUT ]
[ ; ]
Work example
spaddjobschedule creates a schedule for a SQL Server Agent job.
Write a proposed call on paper. Name the target, required permission, expected change, and recovery step before any lab use.
Check your work What can this procedure change or start, and what permission does it need?
Open Microsoft Learn for full syntax, permissions, and details for your version.