Blog Post

Azure Database Support Blog
1 MIN READ

Lesson Learned #162: Cannot show requested dialog obtaining properties database in Managed Instance

Jose_Manuel_Jurado's avatar
Feb 15, 2021

 

Today, I saw this error message when our customer is trying to obtain the properties of a database. This issue sometimes happened when SQL Server Management Studio is trying to obtain the last backup date done in Azure SQL Managed Instance. 

 

 

For example, using SQL Server Profiler or Extended Event Profiler I was able to find the TSQL that SQL Server Management Studio is running, obtaining the same error message. 

 

exec sp_executesql N'
        create table #tempbackup (database_name nvarchar(128), [type] char(1), backup_finish_date datetime)
        insert into #tempbackup select database_name, [type], max(backup_finish_date) from msdb..backupset where [type] = ''D'' or [type] = ''L'' or [type]=''I'' group by database_name, [type]
SELECT
(select backup_finish_date from #tempbackup where type = @_msparam_0 and db_id(database_name) = dtb.database_id) AS [LastBackupDate]
FROM
master.sys.databases AS dtb
WHERE
(dtb.name=@_msparam_1)
        drop table #tempbackup
',N'@_msparam_0 nvarchar(4000),@_msparam_1 nvarchar(4000)',@_msparam_0=N'D',@_msparam_1=N'database name'

 

In this situation, as the backup system that Azure SQL Managed Instance is different than other ones, in order to fix this issue, basically, you need to run the following command: 

 

msdb..sp_delete_database_backuphistory '<database_name>'

 

After it, you are going to be able to obtain the properties of the database. 

 

Enjoy!

Updated Feb 15, 2021
Version 4.0
  • johntrollope's avatar
    johntrollope
    Copper Contributor

    As at 2023-06-19, I can confirm this is still a bug and the above workaround was successful. 

     

    Microsoft SQL Azure (RTM) - 12.0.2000.8
    Apr 27 2023 03:47:17
    Copyright (C) 2022 Microsoft Corporation

  • Jose_Manuel_Jurado is there some other way around it? Having to erase backup history continuously for SSMS to work seems like a bug. (Not that I can figure out how to get that fixed these days...)

     

    I'm having the same problem on my Managed Instance because we're running backups separately to blob storage.  It comes back with two results for the same database_name, one is a GUID and the other is the human-readable name. I'm pretty sure it's because we're using Ola Hallengren's backup code, but ANY backup to blob, I think, would cause the same problem.