SQL Flow Field Guide

CERTPROPERTY

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

cryptographic transform or key lookup

What changes

Input
plaintext or ciphertext and a key, certificate or passphrase
Output or change
ciphertext, plaintext, hash, signature check, or key metadata
Return type
Single quotation marks must enclose the property specification. The return type depends on the property specified in the function call. The return type sql_variant wraps all return values. Expiry_Date

Syntax at a glance

CertProperty ( Cert_ID , '<PropertyName>' )

Work example

Read a documented property from a certificate in an existing database design.

Use synthetic data in an isolated database. Follow the existing key hierarchy and keep keys and plaintext out of output.

Check your work Check property type and expiry meaning before using the value in a review.

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