| title | managed_backup.sp_backup_master_switch (Transact-SQL) | ||||
|---|---|---|---|---|---|
| description | Pauses or resumes the SQL Server Managed Backup to Microsoft Azure. | ||||
| author | markingmyname | ||||
| ms.author | maghan | ||||
| ms.reviewer | randolphwest | ||||
| ms.date | 06/23/2025 | ||||
| ms.service | sql | ||||
| ms.subservice | system-objects | ||||
| ms.topic | reference | ||||
| f1_keywords |
|
||||
| helpviewer_keywords |
|
||||
| dev_langs |
|
[!INCLUDE sqlserver2016]
Pauses or resumes the [!INCLUDE ss-managed-backup].
Use managed_backup.sp_backup_master_switch to temporarily pause and then resume [!INCLUDE ss-managed-backup]. This procedure makes sure that all the configurations settings remain, and are retained when the operations resume. When [!INCLUDE ss-managed-backup] is paused the retention period isn't enforced.
In other words, there's no check to determine:
- whether files should be deleted from storage
- if there are corrupted backup files
- if there's a break in the log chain.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
EXECUTE managed_backup.sp_backup_master_switch [ @new_state = ] { 0 | 1 }
[ ; ]
Set the state of [!INCLUDE ss-managed-backup]. @new_state is bit. When set to a value of 0, the operations are paused, and when set to a value of 1, the operation resume.
0 (success) or 1 (failure).
Requires membership in db_backupoperator database role, with ALTER ANY CREDENTIAL permissions, and EXECUTE permissions on sp_delete_backuphistory stored procedure.
The following example can be used to pause [!INCLUDE ss-managed-backup] on the instance it's executed on:
USE msdb;
GO
EXECUTE managed_backup.sp_backup_master_switch @new_state = 0;
GOThe following example can be used to resume [!INCLUDE ss-managed-backup].
USE msdb;
GO
EXECUTE managed_backup.sp_backup_master_switch @new_state = 1;
GO