Azure SQL Database
An Azure relational database service.
5,977 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
For example, the database can be changed from ONLINE to RECOVERING/RESTORING/OFFLINE, I want to tracking this status change.
The following dynamic management view DMV gives you the state of the database:
SELECT * FROM sys.dm_database_replica_states
See the database_state_desc column in the result.
In addition, the sys.databases DMV provides that information.
SELECT name, user_access_desc, is_read_only, state_desc, recovery_model_desc
FROM sys.databases;