SQL Flow Field Guide

CREATE MASTER KEY

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

defines a master key

What changes

Input
catalog
Output or change
security catalog: master key

Syntax at a glance

CREATE MASTER KEY [ ENCRYPTION BY PASSWORD ='password' ] [ ; ]

Work example

A database needs a database master key for protected key metadata.

Review the key backup, password custody, service master key protection, and restore test with the key owner.

Check your work A recovery test can open the database master key without disclosing its password.

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