SQL Flow Field Guide

ALTER SERVICE MASTER KEY

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

changes a service master key

What changes

Input
catalog
Output or change
security catalog: service master key

Syntax at a glance

ALTER SERVICE MASTER KEY [ { <regenerate_option> | <recover_option> } ] [;]

Work example

The instance service master key needs planned backup or re-protection.

Coordinate the operation with the instance recovery owner and protect the backup outside SQL Server.

Check your work A recovery test opens credentials and certificates protected by the service master key.

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