Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

How can I disable a Job via TSQL Expand / Collapse
Author
Message
Posted Wednesday, May 14, 2008 3:17 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, October 9, 2014 9:03 AM
Points: 821, Visits: 733
Can you do this on a remote server? We have a mirrored database and I want to write a script to enable and disable jobs on both servers in the event of a failover (the script to be run manually).

--
Scott Doughty
Post #500257
Posted Tuesday, August 11, 2009 3:54 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, April 21, 2010 8:29 AM
Points: 20, Visits: 168
thanks very helpful
Post #768464
Posted Tuesday, August 16, 2011 11:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, September 30, 2014 1:02 PM
Points: 8, Visits: 315

SELECT job_id,[name] FROM msdb.dbo.sysjobs


EXEC msdb.dbo.SP_UPDATE_JOB @job_id = 'B9D5575F-56FB-4B34-8180-2728FB70BC0F' , @enabled =1
Post #1160708
Posted Monday, February 13, 2012 6:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, August 2, 2013 5:53 PM
Points: 4, Visits: 43
Does this wait if the job is running at the time before executing the next statement if used in a SP? I've got a job running every five minutes checking for a change to a bunch of tables being fed via web services on another server and refreshes a local copy. I'd like to disable the job, refresh the local copy, which sometimes takes just around or more than five minutes, then re-enable the job running every five minutes.

The timing is a bit too erratic to be tested and I wonder if anyone knows for sure. It would save me considerable time finding out if someone already knew.

Thanks.
Joe
Post #1251621
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse