SQL Flow Field Guide

RESTORE 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
master key key material

Syntax at a glance

RESTORE MASTER KEY FROM { FILE = 'path_to_file' | URL = 'Azure Blob storage URL' } DECRYPTION BY PASSWORD = 'password' ENCRYPTION BY PASSWORD = 'password' [ FORCE ]

Work example

A restored database needs its protected master key opened or recovered.

Use the approved key owner and recovery copy in an isolated restore before production recovery.

Check your work The database opens the key and its dependent certificates work without exposing a password.

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