-> I was trying to rename a database on the Azure managed Instance and got the below expected error,
TITLE: Microsoft SQL Server Management Studio
Unable to rename JB_MI_1. (ObjectExplorer)
Rename failed for Database ‘JB_MI’. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=14.0.17254.0+((SSMS_Rel_17_4).180502-0908)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Rename+Database&LinkId=20476
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Database ‘8b680fc7-b6ab-4d70-be7a-dff62547bf51‘ is enabled for database mirroring or has joined an availability group. The name of the database cannot be changed. (Microsoft SQL Server, Error: 957)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.2000&EvtSrc=MSSQLServer&EvtID=957&LinkId=20476
-> It was unusual to see a GUID as a database name in the message.
-> I checked this further to see if I can understand what this GUID is and tried querying the sys.databases to see if I have some details.
-> The sys.databases has a column called physical_database_name that holds this value.
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.