USE SCHEMA

The USE SCHEMA command lets you shift between schemes within an existing session. If the schema argument is null, USE SCHEMA uses the current schema and switches to the defined schema.

Syntax

USE SCHEMA <schema_name>

You can combine USE commands as shown in the following examples:

USE DATABASE <db_name> SCHEMA <schema_name>
USE SCHEMA <schema_name> DATABASE <db_name>

The compiler executes both of the above commands in the same order regardless of how you write them, switching the database first and the schema second.

Parameters

Parameter

Description

schema_name

The name of the schema.

Examples

USE SCHEMA customers;
USE DATABASE master SCHEMA customers;

Permissions

The USE SCHEMA command requires Comment permission.