CREATE SCHEMA Syntax

Schemas are a concept that was introduced in SQL Server 2005 that replaced object owners. Schemas are methods used to abstract objects into separate categories in order to simplify permissions and help categorization and organization.

To create a schema, simply do the following:

[cc lang=”sql”]
CREATE SCHEMA app AUTHORIZATION dbo
[/cc]

The app represents the name of the schema and the dbo represents the owner of the schema. Users, groups, or roles can be specified as owners.

I personally like to use schemas in order to automatically grant permissions to a group or user. All you have to do is assign specific permissions a user has to a schema then any object you create under that schema, will allow the user that particular permission. This is better than explicitly specifying permissions to every object created.

Featured Articles

 Site Author

  • Thanks for visiting!