SQL Flow Field Guide

RESTORE SERVICE MASTER KEY

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

writes backup content back

What changes

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

Syntax at a glance

RESTORE SERVICE MASTER KEY FROM FILE = 'path_to_file' DECRYPTION BY PASSWORD = 'password' [FORCE]

Work example

An instance recovery plan needs to restore its service master key.

Review instance scope, dependent credentials, certificate access, and the approved backup before recovery.

Check your work A lab instance can read its protected credentials after the restore.

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