How to Enable or Disable SQL Server Agent Job and How to Start Job at Later days - SQL Server DBA Tutorial

In this video you will learn multiple ways of how to enable and disable SQL Server Agent Job, how to schedule jobs that would run in later hours using SQL Server Management Studio as well as T-SQL script. It also explains how to enable or disable Job Schedule as well as how to update SQL Server Agent Job Schedule.

Scripts to Enable or Disable SQL Server Agent Jobs or Schedule to Start Later on Schedule

--disable Job
USE msdb ;
GO

EXEC dbo.sp_update_job
    @job_name = N'BackupAlldb',
   @enabled = 0 ;
GO

--enable job
EXEC dbo.sp_update_job
    @job_name = N'BackupAlldb',
   @enabled = 1 ;

   --Enable Job Schedule
   EXEC dbo.sp_update_schedule
    @name = 'WeeklyRun',
    @enabled = 0

    -- Disable Job Schedule
      EXEC dbo.sp_update_schedule
    @name = 'WeeklyRun',
    @enabled = 1

    --Start Schedule at Later date (04/04/2015)
    USE [msdb]
GO
EXEC msdb.dbo.sp_update_schedule @name=WeeklyRun, 
        @active_start_date=20150404
GO


How to Enable or Disable SQL Server Agent Job in SQL Server

2 comments:

  1. Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. 여성유흥알바

    ReplyDelete
  2. NAturally like your website but you need to test the spelling on quite d few of your psots.
    Several of them are rife with spelling issue ans isn;t finding it very bothersome to tell the truth however i will surely come back again.

    여성알바

    고수익알바

    ReplyDelete