SQL Flow Field Guide

CREATE COLUMN ENCRYPTION KEY

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

defines a column encryption key

What changes

Input
catalog
Output or change
security catalog: column encryption key

Syntax at a glance

CREATE COLUMN ENCRYPTION KEY key_name WITH VALUES ( COLUMN_MASTER_KEY = column_master_key_name, ALGORITHM = 'algorithm_name', ENCRYPTED_VALUE = varbinary_literal ) [, ( COLUMN_MASTER_KEY = column_master_key_name, ALGORITHM = 'algorithm_name', ENCRYPTED_VALUE = varbinary_literal ) ] [;]

Work example

Always Encrypted columns need a data encryption key tied to a master key.

Trace the column encryption key to its master key and confirm the client driver supports the chosen configuration.

Check your work The key metadata points to the approved master key and the client can decrypt a lab value.

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