sys.sp_verify_database_ledger_from_digest_storage (Transact-SQL)

適用於: SQL Server 2022 (16.x) Azure SQL DatabaseAzure SQL 受控執行個體

使用指定外部摘要儲存位置的摘要來驗證資料庫總賬和數據表總帳。

此預存程式會實作與sp_verify_database_ledger相同的總賬驗證演算法。 呼叫端應該提供 JSON 檔,其中包含指向摘要記憶體位置的路徑,例如 Azure Blob 記憶體 容器。

如需資料庫總賬的詳細資訊,請參閱 總賬

Transact-SQL 語法慣例

語法

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'

包含總帳摘要位置清單的 JSON 檔案:

資料行名稱 JSON 資料類型 描述
path string 記憶體摘要的位置。 例如,Azure Blob 儲存體 中容器的路徑。
last_digest_block_id int 上次上傳摘要的區塊標識碼。
is_current boolean 指出這是過去所使用的目前路徑或路徑。

[ @table_name = ] 'table_name'

您要驗證之總賬資料表的名稱。 此引數是選擇性的。 如果未指定此專案,則會驗證整個資料庫總賬和總賬數據表。

輸入 JSON 檔的範例:

[
    {
        "path": "https://mystorage.blob.core.windows.net/sqldbledgerdigests/serverName/DatabaseName/2020-1-1 00:00:00Z",
        "last_digest_block_id": 42,
        "is_current:true"
    },
    ...
]

傳回碼值

0 (成功)或 1 (失敗)。

結果集

一個資料列,其中一個資料行稱為 last_verified_block_id

權限

需要 VIEW LEDGER CONTENT 許可權。