Physical_database_name column in sys.databases

-> 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:
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:

-> 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.


Thank You,
Vivek Janakiraman

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.

Leave a Reply