Hot answers tagged

2

You can use the @subsystem=N'TSQL' parameter of the sp_update_jobstep to alter the Step-Type. Refer to sp_add_jobstep for a list of valid subsystem values. Example: EXEC msdb.dbo.sp_update_jobstep @job_name = N'test' ,@step_id = 1 ,@subsystem = N'TSQL' ,@command = N'EXECUTE [dbo].[IndexOptimize], @Databases = ''USER_DATABASES'', @LogToTable = '...


1

Implied by Learning_DBAdmin's answer, what you do is not supported. Modifying the system tables directly, that is. You should use the interface that is provided for us, the agent stored procedures. FWIW, if you read the source code, for instance sp_update_jobschedule, you'll find a call to sp_sqlagent_notify. This isn't documented, however, for above reason....


1

You may use below script to alter the schedule: EXEC msdb.dbo.sp_attach_schedule @job_id=N'533fb186-72e9-40c5-af88-c8e57f097126',@schedule_id=16 GO USE [msdb] GO EXEC msdb.dbo.sp_update_schedule @schedule_id=16, @active_start_time=24500 GO you may find job_id using below script for the job you want to change schedule: select job_id from msdb.....


Only top voted, non community-wiki answers of a minimum length are eligible