SQL Flow Field Guide

BACKUP SERVICE MASTER KEY

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

copies service master key key material out

What changes

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

Syntax at a glance

BACKUP SERVICE MASTER KEY TO FILE = 'path_to_file' ENCRYPTION BY PASSWORD = 'password'

Work example

An instance recovery plan needs a protected copy of its service master key.

Confirm the destination, encryption secret custody, instance owner, and recovery procedure with the DBA.

Check your work A recovery test uses the saved key to access dependent instance credentials.

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