DROP SYNONYM (Transact-SQL)
Removes a synonym from a specified schema.
Transact-SQL Syntax Conventions
DROP SYNONYM [ schema. ] synonym_name
Specifies the schema in which the synonym exists. If schema is not specified, SQL Server 2005 uses the default schema of the current user.
Is the name of the synonym to be dropped.
References to synonyms are not schema-bound; therefore, you can drop a synonym at any time. References to dropped synonyms will be found only at run time.
Synonyms can be created, dropped and referenced in dynamic SQL.
To drop a synonym, a user must satisfy at least one of the following conditions. The user must be:
The current owner of a synonym.
A grantee holding CONTROL on a synonym.
A grantee holding ALTER SCHEMA permission on the containing schema.
The following example first creates a synonym,
MyProduct, and then drops the synonym.
-- Create a synonym for the Product table in AdventureWorks.
CREATE SYNONYM MyProduct
-- Drop synonym MyProduct.
DROP SYNONYM MyProduct;
( 1500 characters remaining)
Thank you for your feedback