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
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
ALTERpermission on the schema.
How to fix it
-
Create the schema if it should exist.
CREATE SCHEMAmust be alone in its batch, or run throughEXEC.IF SCHEMA_ID(N'sales') IS NULL EXEC (N'CREATE SCHEMA sales AUTHORIZATION dbo'); -
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
207Invalid column name4104Multi-part identifier not bound209Ambiguous column name2812Could not find stored procedure2714There is already an object named3701Cannot drop, object not found3702Cannot drop database, currently in use5030Database couldn't be exclusively locked
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.
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.