Remove-UniqueKey

Removes the Unique Constraint from the database

Syntax

Remove-UniqueKey [-TableName] <String> [-SchemaName <String>] [-ColumnName] <String[]> [<CommonParameters>]
Remove-UniqueKey [-TableName] <String> [-SchemaName <String>] [-Name] <String> [<CommonParameters>]

Description

Removes the Unique Constraint from the database.

Parameters

Name Type Description Required? Pipeline Input Default Value
TableName String

The name of the target table.

true false
SchemaName String

The schema name of the target table. Defaults to dbo.

false false dbo
ColumnName String[]

OBSOLETE. Use the Name parameter to specify the name of the unique key to remove.

true false
Name String

The name of the unique key to remove.

true false

EXAMPLE 1

Remove-UniqueKey 'Cars' -Name 'YearUK'

Demonstrates how to remove a unique key whose name is different than the name Rivet derives for unique keys.