Remove-Index

Removes an index from a table.

Syntax

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

Description

The Remove-Index operation removes an index from a table.

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 remove an index.

true false
Unique SwitchParameter

OBSOLETE. Use the Name parameter to remove an index.

false false False
Name String

The name of the index to remove.

true false

EXAMPLE 1

Remove-Index 'Cars' -Name 'YearIX'

Demonstrates how to drop an index