DROP SYNONYM in SQL Server

An alternative name or alias for a table, view, sequence, or other schema item is known as a synonym in databases. In dynamic SQL, it can be created, removed, and referenced. The Synonyms can be deleted using the DROP statement, much like other database objects.

Synonym references are not schema-bound, therefore you are free to remove any synonym at any moment. Only at run time will references to dropped synonyms be discovered.

Syntax:
DROP SYNONYM [ IF EXISTS ] [ schema. ] synonym_name

Example:
DROP SYNONYM Trxns;

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s