sql - change next_run_time at a job -
i have jobs in sql , need change next run date , time code. have following stored procedure updates job, job not starts @ specified time:
create procedure [dbo].[pu_usp_update_ssis_package] @job_id varchar(50) , @next_run_date int, @next_run_time int begin update msdb.dbo.sysjobschedules set next_run_date = @next_run_date, next_run_time = @next_run_time job_id = @job_id end
the data updated in table msdb.dbo.sysjobschedules
job, don't know why job not starts
here updates stored procedure
create procedure [dbo].[pu_usp_update_ssis_package] @job_id varchar(50) , @next_run_date int, @next_run_time int begin declare @schedule_id int set @schedule_id = (select msdb.dbo.sysjobschedules.schedule_id msdb.dbo.sysjobschedules job_id = @job_id) exec msdb..sp_update_schedule @schedule_id = @schedule_id, @active_start_date = @next_run_date, @active_start_time = @next_run_time end
Comments
Post a Comment