What is a Schema?
In Microsoft SQL Server 2005, a schema is a collection of objects adhering to the ANSI SQL-92 standard.
The ANSI SQL-92 standard defines a schema as a collection of database objects that are owned by a single principle and form a single namespace.
All objects within a schema must be uniquely named and a schema must be uniquely named in the database catalog. SQL Server 2005 breaks the link between users and schemas, users do not own objects. Schemas own objects and principles own schemas.
A schema can be owned by either a primary or secondary principle, with the term “principle” meaning any SQL Server entity that can access securable objects.
Principle types that can own schemas:
- Primary
- SQL Server Login
- Database User
- Windows Login
- Secondary
- SQL Server Roles
- Windows Groups
- Default Schemas
Users can now have a default schema assigned using the DEFAULT_SCHEMA option of CREATE USER and ALTER USER commands. If no default schema is supplied for a user then DBO will be used as the default schema.
——————————————————————————–
SQL Server 2005 Schema Objects
- Tables
- Indexes
- Views
- Synonyms
- Stored Procedures
- Triggers
- Functions
- Assemblies
- Types
- Defaults
#1 by Rashmi on June 12, 2009 - 12:25 pm
Thanks!! This makes the purpose of schema in sql server 2005+ very clear.
#2 by josphine on May 31, 2010 - 4:42 am
thanks it is very useful…
#3 by Koteswar Rao on June 3, 2010 - 8:01 am
Thanks …it’s very clear……….
#4 by kinjal panchal on June 10, 2010 - 7:10 am
its really nice article thnx a lot ….its easy to understand wht is schema…it is really helpful…
#5 by Anuradha on July 2, 2010 - 5:13 am
Commemorate answer…….Thanks!!!!!!!!
#6 by sunil on August 6, 2010 - 6:16 am
really helpful
#7 by chana on August 13, 2010 - 4:03 am
Good.
#8 by claude on September 1, 2010 - 12:50 am
Simple and very clear, keep this up