List schemas in Azure SQL Database

The query below lists all the schemas in the Azure SQL Database. Schemas include the default db_* , sys, information_schema and guest schemas.

If you want to list only user schemas, use this script.


select as schema_name,
    s.schema_id, as schema_owner
from sys.schemas s
    inner join sys.sysusers u
        on u.uid = s.principal_id
order by


  • schema_name - name of the schema
  • schema_id - schema id, which is unique within the database
  • schema_owner - principal that owns this schema


  • One row: represents one schema in a database
  • Scope of rows: all schemas in a database, including the default ones
  • Ordered by: schema name

Sample results

Here is a view of database schemas in SSMS:

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
There are no comments. Click here to write the first comment.