Configure a ledger database
Applies to: SQL Server 2022 (16.x) Preview
Azure SQL Database
This article provides information on configuring a ledger database using the Azure portal, T-SQL, PowerShell, or the Azure CLI for Azure SQL Database. For information on creating a ledger database in SQL Server 2022, use the switch at the top of this page to toggle over to SQL Server.
Prerequisites
- Have an active Azure subscription. If you don't have one, create a free account.
- An Azure SQL Database.
Enable ledger database
Open the Azure portal and create an Azure SQL Database if you don't already have one.
In the Security tab, select the Ledger option.
In the Ledger pane, select Enable for all future tables in this database.
Select Apply to save this setting.
This article provides information on creating a ledger database using T-SQL in SQL Server 2022. For information on creating a ledger database in Azure SQL Database, use the switch at the top of this page to toggle over to Azure SQL Database.
Prerequisites
- SQL Server 2022
- SQL Server Management Studio (SSMS) or Azure Data Studio
Create a ledger database using T-SQL
Sign into your SQL Server 2022 instance using SSMS or Azure Data Studio.
Create a ledger database using the following T-SQL statement:
CREATE DATABASE MyLedgerDB WITH LEDGER = ON;
For more information, see CREATE DATABASE (Transact-SQL).
Next steps
Feedback
Submit and view feedback for