| title | Disable or Enable a Job | Microsoft Docs | ||||
|---|---|---|---|---|---|
| ms.custom | |||||
| ms.date | 01/19/2017 | ||||
| ms.prod | sql | ||||
| ms.prod_service | sql-tools | ||||
| ms.reviewer | |||||
| ms.technology | ssms | ||||
| ms.topic | conceptual | ||||
| helpviewer_keywords |
|
||||
| ms.assetid | 5041261f-0c32-4d4a-8bee-59a6c16200dd | ||||
| author | stevestein | ||||
| ms.author | sstein | ||||
| manager | craigg | ||||
| monikerRange | = azuresqldb-mi-current || >= sql-server-2016 || = sqlallproducts-allversions |
[!INCLUDEappliesto-ss-asdbmi-xxxx-xxx-md]
Important
On Azure SQL Database Managed Instance, most, but not all SQL Server Agent features are currently supported. See Azure SQL Database Managed Instance T-SQL differences from SQL Server for details.
This topic describes how to disable a [!INCLUDEssNoVersion] Agent job in [!INCLUDEssCurrent] by using [!INCLUDEssManStudioFull] or [!INCLUDEtsql]. When you disable a job, it is not deleted and can be enabled again when necessary.
In This Topic
-
Before you begin:
-
To disable or enable a job, using:
For detailed information, see Implement SQL Server Agent Security.
-
In Object Explorer, connect to an instance of the [!INCLUDEssDEnoversion], and then expand that instance.
-
Expand SQL Server Agent.
-
Expand Jobs, and then right-click the job that you want to disable or enable.
-
To disable a job, click Disable. To enable a job, click Enable.
-
In Object Explorer, connect to an instance of [!INCLUDEssDE].
-
On the Standard bar, click New Query.
-
Copy and paste the following example into the query window and click Execute.
-- changes the name, description, and disables status of the job NightlyBackups. USE msdb ; GO EXEC dbo.sp_update_job @job_name = N'NightlyBackups', @new_name = N'NightlyBackups -- Disabled', @description = N'Nightly backups disabled during server migration.', @enabled = 0 ; GO
For more information, see sp_update_job (Transact-SQL).