SQL Flow Field Guide

sys.sp_verify_database_ledger

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

recomputes hashes and compares with digests

What changes

Input
ledger tables, ledger views, stored digests
Output or change
verification result

Syntax at a glance

sp_verify_database_ledger
    [ @digests = ] 'digests'
    [ , [ @table_name = ] 'table_name' ]

Work example

An auditor needs to compare database ledger history with saved external digests.

Select the correct database and digest set, then retain the verifier output with its source records.

Check your work The verification reports no tampering and every expected digest is accounted for.

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