Schemas

New: 14 April 2006

A schema is a container that holds tables, views, procedures, and so on. It is inside a database, which is inside a server. These entities fit together like nested boxes. The server is the outermost box, and the schema is the innermost box. It holds all of the securables listed below. But it cannot hold another box.

Securable that must be inside a schema Class

Type

TYPE

XML Schema Collection

XML SCHEMA COLLECTION

Table

OBJECT

View

OBJECT

Procedure

OBJECT

Function

OBJECT

Aggregate

OBJECT

Constraint

OBJECT

Synonym

OBJECT

Queue

OBJECT

Statistic

OBJECT

Every securable in a specific schema must have a unique name. The fully-specified name of a securable contained by a schema includes the name of the schema that contains it. Thus, a schema is also a namespace.

Note

In earlier releases of SQL Server, databases could contain an entity called a "schema", but that entity was effectively a database user. SQL Server 2005 is the first release of SQL Server in which a schema is both a container and a namespace.

See Also

Concepts

User-Schema Separation
Securables
Permissions Hierarchy

Help and Information

Getting SQL Server 2005 Assistance