Fix ServerProperty query stops working on Azure after failover (#6794)
This commit is contained in:
parent
1aee98f064
commit
94fc769e0b
|
@ -432,8 +432,9 @@ IF SERVERPROPERTY('EngineEdition') = 5 -- Azure SQL DB
|
||||||
NULL AS available_storage_mb, -- Can we find out storage?
|
NULL AS available_storage_mb, -- Can we find out storage?
|
||||||
NULL as uptime
|
NULL as uptime
|
||||||
FROM sys.databases d
|
FROM sys.databases d
|
||||||
JOIN sys.database_service_objectives slo
|
-- sys.databases.database_id may not match current DB_ID on Azure SQL DB
|
||||||
ON d.database_id = slo.database_id
|
CROSS JOIN sys.database_service_objectives slo
|
||||||
|
WHERE d.name = DB_NAME() AND slo.database_id = DB_ID()
|
||||||
|
|
||||||
ELSE
|
ELSE
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
Loading…
Reference in New Issue