MichaelB.
7/28/2018 - 12:18 PM

CREATE SCHEMA

Container used to group objects. Allows you to define security for objects contained in schema as a group.

SQL Server

In earlier versions of SQL Server the schema did not actually exist as something you could use. It was an owner object. Simplify security:

  • DB objects are owned by schemas
  • Permissions can be set at the schema level
  • Objects can easily be moved from one schema to another
CREATE SCHEMA schemaname;

-- Create schema and set authorization to a user
CREATE SCHEMA DirectMarketing
AUTHORIZATION [dbo];