Ledger database vs ledger tables

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.

There is sometimes a misconception among the usage of a ledger database and ledger tables. In this blog post, I will explain the main difference and how they work together to provide tamper-evidence capabilities for your data.

 

 

PieterVanhove_1-1695123482446.png

 

A ledger database is a database that has the ledger property set to on, WITH LEDGER = ON. This means that all new tables created in the database will be updatable ledger tables by default unless you specify the APPEND_ONLY = ON clause to create append-only ledger tables. Note that a ledger database can only be configured at creation time. Once created, a ledger database cannot be converted to a regular database. Ledger databases are often used for applications that require high integrity, auditability, and compliance, such as financial systems, supply chain management, or identity management. Have a look at our documentation on how to create a ledger database.

 

Does this mean that you NEED to create a ledger database before you can use the ledger functionality? Absolutely not! The ledger feature is available in every Azure SQL Database, Azure SQL Managed Instance and SQL Server 2022 database. You only need to create an updatable or append-only ledger table to guarantee data integrity at a table level.

 

To summarize, ledger databases provide an easy solution for applications that require the integrity of all data to be protected for the entire lifetime of the database. A ledger database can only contain ledger tables. Creating regular tables (that are not ledger tables) is not supported. If you need integrity at table level, just create an updatable or append-only ledger table in your regular database. There’s no need to “switch ledger on at the database level”.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.