SQL Flow Field Guide

BACKUP MASTER KEY

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

copies master key key material out

What changes

Input
master key key material
Output or change
backup device, file or URL

Syntax at a glance

BACKUP MASTER KEY TO { FILE = 'path_to_file' | URL = 'Azure Blob storage URL' } ENCRYPTION BY PASSWORD = 'password'

Work example

A database master key needs a recovery copy stored outside the database backup.

Use the approved secret process and record the file owner, access path, and restore test.

Check your work A lab restore opens the master key without exposing its password in code or logs.

Open Microsoft Learn for full syntax, permissions, and details for your version.