Jon Onstott
Jon Onstott

Reputation: 13727

Uses for SQL Server schemas

It's my impression that schemas are mainly for organizing the tables, view, stored procedures, etc... in a SQL Server database. Do schemas play a bigger role (perhaps in database security, storage, etc)?

Some clarification: I'm referring to "object" schemas. Sorry for the confusion.

Thank you.

Upvotes: 4

Views: 1702

Answers (3)

dr.
dr.

Reputation: 1449

Schemas allow you to group your tables for security and/or conceptual sanity. The group could be a department, a specific area of an application, Active Directory group, db role, etc.

If you have a group of tables that only your HR security group needs access to you can create them under the HR schema and enforce the priviledges from there.

If you have an application you might want to create schemas for Sales, Content, and Products just to separate the parts of the application.

Upvotes: 4

Arnkrishn
Arnkrishn

Reputation: 30424

Check this link http://technet.microsoft.com/en-us/library/dd283095.aspx. It covers security aspects under the section 'Using Schemas in SQL Server'.

cheers

Upvotes: 3

Janie
Janie

Reputation: 1933

From an OO perspective, a database schema could be thought of as a class; with the database itself representing an object instance of that class.

The same implications apply from this analogy (re: security, memory use, etc)

Upvotes: -1

Related Questions