// SQL Server error reference

SQL Server error 3701: Cannot drop, object not found

A DROP named an object that doesn't exist in the current database, or that you don't have permission to see. Use DROP ... IF EXISTS in scripts.

Error number
3701
Severity
11
Category
Names and objects
Error message
Cannot %S_MSG the %S_MSG '%.*ls', because it does not exist or you do not have permission.

What it means

SQL Server raises 3701 when DROP TABLE, DROP VIEW, DROP PROCEDURE and similar statements can't find the object. It deliberately doesn't say whether the object is missing or hidden from you by permissions. The severity is 11, so the batch continues after it.

Common causes

  • The object was already dropped, or never created in this environment.
  • Running in the wrong database or without the schema prefix.
  • Lacking permission to see the object, which makes it look absent.

How to fix it

  1. Use the IF EXISTS form so scripts can be run repeatedly.

    DROP TABLE IF EXISTS dbo.Staging;
    DROP PROCEDURE IF EXISTS dbo.LoadStaging;
  2. On versions before SQL Server 2016, guard with OBJECT_ID.

    IF OBJECT_ID(N'dbo.Staging', N'U') IS NOT NULL
        DROP TABLE dbo.Staging;
  3. Check the current database and the schema-qualified name.

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.