How to Check the Recovery Model of a Database in Azure SQL Edge using T-SQL

In Azure SQL Edge, you can query the sys.databases catalog view to see the recovery model for each database.

Example

Here’s an example to demonstrate:

SELECT 
    name,
    recovery_model_desc
FROM sys.databases;

Result:

+--------------------+-----------------------+
| name               | recovery_model_desc   |
|--------------------+-----------------------|
| master             | SIMPLE                |
| tempdb             | SIMPLE                |
| model              | SIMPLE                |
| msdb               | SIMPLE                |
| Music              | SIMPLE                |
| KrankyKranes       | SIMPLE                |
| PetHotel           | SIMPLE                |
| WideWorldImporters | SIMPLE                |
+--------------------+-----------------------+

The master, tempdb, model, and msdb databases all use the simple recovery model by default.

By default, databases created in Azure SQL Edge use the simple recovery model, and this is reflected in my example. This is because the model database uses the simple recovery model. If you want all new databases to use the full recovery model, change the model database to use the full recovery model.

If you don’t want to list all databases, you can always use a WHERE clause to narrow it down to just one database:

SELECT 
    name, 
    recovery_model_desc  
FROM sys.databases
WHERE name = 'KrankyKranes';

Result:

+--------------+-----------------------+
| name         | recovery_model_desc   |
|--------------+-----------------------|
| KrankyKranes | SIMPLE                |
+--------------+-----------------------+

You can always change the recovery model if you need to.