DROP SCHEMA

Removes a schema from the virtual database.

Syntax

DROP SCHEMA  [ IF EXISTS ] schema_name
[;]

Arguments

IF EXISTS

Conditionally drops the schema only if it already exists.

schema_name

Is the name by which the schema is known within the virtual database.

Remarks

The schema that is being dropped must not contain any objects. If the schema contains objects, the DROP statement fails.

Information about schemas is visible in the sys.schemas catalog view.

Permissions

Requires CONTROL permission on the schema or ALTER ANY SCHEMA permission on the database.

Examples

Drop schema Stage from the current virtual database.

DROP SCHEMA Stage;

See also