Disable all SQL jobs using one script


Most of the DBA’s might have came across a situation where they want to disable all SQL jobs for DR environments or test environments.Below script does this for you and is really handy on servers where there are many jobs:-

USE MSDB;
GO
UPDATE MSDB.dbo.sysjobs
SET Enabled = 0
WHERE Enabled = 1;
GO

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s