Updated on 2025-07-22 GMT+08:00

DROP SYNONYM

Function

DROP SYNONYM is used to delete a synonym object.

Precautions

Only a synonym owner or a system administrator can run the DROP SYNONYM command.

Syntax

1
DROP SYNONYM [ IF EXISTS ] synonym_name [ CASCADE | RESTRICT ];

Parameter Description

Table 1 DROP SYNONYM parameters

Parameter

Description

Value Range

IF EXISTS

Sends a notice instead of reporting an error if the specified synonym does not exist.

-

synonym_name

Name of a synonym which is deleted (optionally with schema names)

An existing synonym name.

CASCADE | RESTRICT

Specifies how to process related data in the dependent object when a delete operation is performed.

  • CASCADE: automatically deletes objects (such as views) that depend on the synonym to be deleted.
  • RESTRICT: refuses to delete the synonym if any objects depend on it. This is the default.

Examples

Delete synonyms:

1
DROP SYNONYM t1;

Helpful Links

ALTER SYNONYM and CREATE SYNONYM