Remove-ExtendedProperty

Drops an extended property for a schema, table, or column.

Syntax

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

Description

SQL Server has a special stored procedure for removing extended property metatdata about an object. Unfortunately, it has a really clunky interface. This function is an attempt to wrap sp_dropextendedproperty with a saner interface.

Currently, this function only supports dropping properties for schemas, tables, and columns. Submit a patch!

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String

The name of the extended property to add.

true false
SchemaName String

The schema of the object.

false false dbo
TableName String

The table name.

true false
ViewName String

The table name.

true false
ColumnName String

The column name.

true false

EXAMPLE 1

Remove-ExtendedProperty -Name 'Deploy' -SchemaName 'spike'

Drops the custom Deploy metadata for the spike schema.

EXAMPLE 2

Remove-ExtendedProperty -Name 'Deploy' -TableName 'Food'

Drops the custom Deploy metadata on the Food table in the dbo schema.

EXAMPLE 3

Remove-ExtendedProperty -Name 'IsEncrypted' -TableName 'User' -ColumnName 'Password'

Drops the custom IsEncrypted metadata on the User table's Password column.

EXAMPLE 4

Remove-ExtendedProperty -Name 'ContainsPII' -View 'LoggedInUsers'

Demonstrates how to remove custom metadata on the LoggedInUsers view

EXAMPLE 5

Remove-ExtendedProperty -Name 'IsEncrypted' -View 'LoggedInUsers' -ColumnName 'Password'

Demonstrates how to remove custom metadata for a view's column