Creating and managing database schemas
A schema is a logical container that groups objects of similar scope or ownership together. By default, the database owner (dbo
) schema is automatically created in a SQL Server database. Unless you specify otherwise, all SQL Server user objects are created in the database owner (dbo
) schema. You can define different default schemas for each user of the database. When you create a user database, SQL Server automatically creates these schemas: sys
, dbo
, INFORMATION_SCHEMA
, and guest
.
You can query the sys.schemas
system catalog view to see the schemas defined for the database. The following is the syntax to query this system catalog:
SELECT * FROM sys.schemas
You can also use SQL Server Management Studio 2014 to list the schemas defined for the database. To list the schemas defined for the database in SQL Server 2014 Management Studio, use the following steps:
- In Object Explorer, expand the
Databases
folder. - Next, select the database and expand the
Security...