SQL Interview: 33 Physical Database Name in sys.databases

SQL Interview: 33 Physical Database Name in sys.databases

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Administration Level: Medium

Question:

You query the sys.databases view and notice that the value in the physical_database_name column for a database is different to the name column.

Can you give an example of why this might occur?

Answer:

Azure SQL Databases have a logical name (i.e., the name that you call them and that appears in Object Explorer), but they also have a physical database name that’s an internal reference to the database. In most cases, this would be a GUID.

The same can apply to any of the software as a service offerings like Azure SQL Managed Instance.

2025-04-04