// SQL Server error reference

SQL Server error 2760: Schema does not exist or no permission

CREATE or ALTER named a schema that doesn't exist in this database, or that you aren't allowed to use. Create the schema or fix the name.

Error number
2760
Severity
16
Category
Names and objects
Error message
The specified schema name "%.*ls" either does not exist or you do not have permission to use it.

What it means

Creating an object such as CREATE TABLE sales.Orders requires the schema sales to exist and you to have ALTER permission on it. Otherwise SQL Server raises 2760.

Common causes

  • The schema hasn't been created in this database yet.
  • Running the script in the wrong database.
  • Missing ALTER permission on the schema.

How to fix it

  1. Create the schema if it should exist. CREATE SCHEMA must be alone in its batch, or run through EXEC.

    IF SCHEMA_ID(N'sales') IS NULL
        EXEC (N'CREATE SCHEMA sales AUTHORIZATION dbo');
  2. Grant permission to create objects in it.

    GRANT ALTER ON SCHEMA::sales TO app_user;
    GRANT CREATE TABLE TO app_user;

Related errors

More names and objects errors

The code and message text are from the Microsoft Database Engine events and errors reference. Browse the full SQL Server error list or search every database error.

// fewer errors, faster fixes

Work on SQL Server in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQL Server and the other databases you use.