Remove-Synonym

Drops a synonym.

Syntax

Remove-Synonym [-Name] <String> [-SchemaName <String>] [<CommonParameters>]

Description

Drops an existing synonym. If the synonym doesn't exist, you'll get an error.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the synonym to drop.

true false
SchemaName String

The name of the synonym's schema. Default to dbo.

false false dbo

EXAMPLE 1

Remove-Synonym -Name 'Buzz'

Removes the Buzz synonym.

EXAMPLE 2

Remove-Synonym -SchemaName 'fiz' -Name 'Buzz'

Demonstrates how to remove a synonym in a schema other than dbo.