- Error number
- 3701
- Severity
- 11 (user-correctable error)
- State
- 5 (see the state table below)
- Product
- Microsoft SQL Server Database Engine
- Versions
- All supported SQL Server versions (2016 to 2025), Azure SQL Database, Azure SQL Managed Instance
- Category
- Syntax & Object Resolution
- Last reviewed
- 23 October 2026
On this page
What it means
Error 3701 means a DROP statement could not find the named object in the current database and schema, or found it but you are not allowed to drop it.
The message has the form Cannot drop the <type> '<name>', so it tells you the object type and the name exactly as SQL Server looked for it. The level and state tell you which half of "does not exist or you do not have permission" applies: level 11 (state 5, or 7 for an index) means nothing with that name was found, and level 14 state 20 means the object is there but your user lacks the permission to drop it. In the permission form the name appears without its schema.
Dropping a table needs ALTER on its schema or CONTROL on the table (or membership of db_ddladmin or db_owner); SELECT or even INSERT permission is not enough. DROP ... IF EXISTS only silences the not-found case: in the permission case it still fails with 3701. Schemas and types have their own messages (DROP SCHEMA raises 15151, DROP TYPE raises 218).
| State | Meaning |
|---|---|
| 5 | The object (table, view, procedure, function, synonym) was not found. Level 11. Observed on SQL Server 2025. |
| 7 | DROP INDEX: the index was not found on that table. Level 11. Observed on SQL Server 2025. |
| 20 | The object exists, but the caller lacks permission to drop it. Raised at level 14, also with IF EXISTS. Observed on SQL Server 2025. |
Common causes
- The object was already dropped, for example by an earlier run of the same script.
- The object lives in another schema than the one in the DROP (or the DROP has no schema and your default schema is not where the object is).
- The session is connected to a different database than the one that holds the object.
- A typo in the name. (Using the wrong statement for an object that does exist, such as DROP VIEW on a table, raises error 3705 instead.)
- The object exists but your user has only data permissions on it, not ALTER on the schema or CONTROL on the object.
Diagnose it
Read-only These queries only read metadata and dynamic management views. They do not change data, permissions or configuration, so they are safe to run first.
Does the object exist, and in which schema?
SELECT DB_NAME() AS current_database, SCHEMA_NAME(o.schema_id) AS schema_name, o.name, o.type_desc
FROM sys.objects AS o
WHERE o.name = N'Orders'; No rows: the object is not in this database (check the database you are connected to). A row with a different schema or type: correct the DROP statement.
May the current user drop it?
SELECT HAS_PERMS_BY_NAME(N'Archive.Orders', N'OBJECT', N'CONTROL') AS control_on_table,
HAS_PERMS_BY_NAME(N'Archive', N'SCHEMA', N'ALTER') AS alter_on_schema; Both 0 means the DROP fails with level 14, state 20 even though the table exists. Either 1 is enough to drop it.
For DROP INDEX, list the indexes the table really has
SELECT i.name AS index_name, i.type_desc, i.is_primary_key, i.is_unique_constraint
FROM sys.indexes AS i
WHERE i.object_id = OBJECT_ID(N'dbo.Orders')
AND i.name IS NOT NULL; The exact index names. Indexes behind a PRIMARY KEY or UNIQUE constraint are removed with ALTER TABLE ... DROP CONSTRAINT, not DROP INDEX.
How to fix it
Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.
Use the schema-qualified name the object really has
Changes schemaTake the schema and type from the first diagnostic and drop exactly that object.
DROP TABLE Archive.Orders;
Make re-runnable scripts use IF EXISTS
Changes schemaDROP ... IF EXISTS (SQL Server 2016 and later) does nothing when the object is missing. It does not bypass permissions: a level 14 state 20 error still means you need rights.
DROP TABLE IF EXISTS dbo.Orders;
DROP PROCEDURE IF EXISTS dbo.usp_ArchiveOrders;
DROP INDEX IF EXISTS IX_Orders_total ON dbo.Orders;
Grant the permission to drop objects in the schema
Changes permissionsRun as the schema owner or a member of db_owner. Use a role so the right is easy to review and remove.
Caution:
ALTER on a schema lets the user alter and drop every object in that schema. Grant it to a deployment role rather than to application users, and prefer CONTROL on a single object when only one object is involved.
GRANT ALTER ON SCHEMA::dbo TO deploy_role;
-- or, for one object only:
GRANT CONTROL ON OBJECT::dbo.Orders TO deploy_role;
Examples
Dropping a table that does not exist
-- dbo.Orders was never created in this database, or was already dropped
DROP TABLE dbo.Orders;
Msg 3701, Level 11, State 5, Line 2 Cannot drop the table 'dbo.Orders', because it does not exist or you do not have permission.
Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.
Right table, wrong schema
CREATE SCHEMA Archive;
GO
CREATE TABLE Archive.Orders (id INT PRIMARY KEY);
GO
DROP TABLE dbo.Orders; -- the table is Archive.Orders
Msg 3701, Level 11, State 5, Line 2 Cannot drop the table 'dbo.Orders', because it does not exist or you do not have permission.
Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.
The table exists, but the user may only read it
CREATE TABLE dbo.Orders (id INT PRIMARY KEY);
CREATE USER report_reader WITHOUT LOGIN;
GRANT SELECT ON dbo.Orders TO report_reader;
GO
EXECUTE AS USER = 'report_reader';
DROP TABLE IF EXISTS dbo.Orders; -- IF EXISTS does not help here
REVERT;
Msg 3701, Level 14, State 20, Line 3 Cannot drop the table 'Orders', because it does not exist or you do not have permission.
Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.
How to prevent it
Write deployment and teardown scripts with two-part names and IF EXISTS, and set the target database in the connection rather than relying on a default. Re-running such a script is then harmless.
Run schema changes under a dedicated deployment login or role that has ALTER on the schemas it manages, and keep application users to data permissions. A 3701 at level 14 is then a clear sign that a script is running under the wrong account. See the SQL security lesson for permission design.
Common questions
DROP TABLE IF EXISTS still raises 3701. Why?
IF EXISTS only handles a missing object. If the table exists and you lack ALTER on the schema or CONTROL on the table, SQL Server still raises 3701, at level 14 state 20, instead of doing nothing.
How can I tell "does not exist" from "no permission"?
Look at the level and state: level 11 state 5 (or 7 for an index) means not found; level 14 state 20 means permission. Then confirm with sys.objects and HAS_PERMS_BY_NAME as shown above.
Why does DROP SCHEMA give a different error?
Schemas, users and types have their own messages. DROP SCHEMA on a missing schema raises 15151 and DROP TYPE raises 218; their fixes are the same idea: check the name and use IF EXISTS.
Learn more on CodeWithSQL
Official documentation
- DROP TABLE (Transact-SQL)
- HAS_PERMS_BY_NAME (Transact-SQL)
- DROP INDEX (Transact-SQL)
- Database Engine events and errors 3000 to 3999
Last technically reviewed 23 October 2026; examples and diagnostics run on SQL Server 2025 (17.0.1145.4). Message text checked against the engine's sys.messages catalogue.