SQL Server - Schema

1 - Management

1.1 - Owner

The new schema is owned by one of the following database-level principals:

  • database user,
  • database role,
  • or application role.

Objects created within a schema are owned by the owner of the schema. The ownership can be transferred but the schema owner always retains CONTROL permission on objects within the schema.

1.2 - Create


CREATE SCHEMA schemaName AUTHORIZATION dbo;

Reference

1.3 - See


SELECT * FROM sys.schemas;

1.4 - Default

The default schema name can be seen in the principal table.


SELECT * FROM sys.database_principals;

and can be modified for the user


ALTER USER myUser WITH DEFAULT_SCHEMA = myschema
create USER myUser WITH DEFAULT_SCHEMA = myschema


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap