sys.sp_verify_database_ledger_from_digest_storage (Transact-SQL)

Applies to: Azure SQL Database

Verifies the database ledger and the table ledgers using digests at the specified external digest storage locations.

This stored procedure implements the same ledger verification algorithm as sp_verify_database_ledger. A caller is expected to provider a JSON, which contains the paths pointing to digest storage locations, such as Azure Blob storage containers.

For more information on database ledger, see Ledger

Transact-SQL syntax conventions


sp_verify_database_ledger_from_digest_storage [@locations = ] 'JSON_document_with_digest_storage_locations' [ , [@table_name = ] 'table_name' ] 


[ @locations = ] 'JSON_document_with_digest_storage_locations'

A JSON document containing a list of ledger digests locations:

Column name JSON data type Description
path string The location of storage digests. For example, a path for a container in Azure Blob Storage.
last_digest_block_id int The block ID for the last digest uploaded.
is_current boolean Indicates whether this is the current path or a path used in the past.

[ @table_name = ] 'table_name'

The name of the ledger table you want to verify. This is an optional argument, if this is not specified the whole database ledger and the ledger tables are verified.

Example of the input JSON document:

[{"path": " 00:00:00Z", "last_digest_block_id":42, "is_current:true"} , … ]

Return code values

0 (success) or 1 (failure).

Result sets

1 row with 1 column called: last_verified_block_id


Requires the VIEW LEDGER CONTENT permission.

See also