Update-ExtendedProperty

Updates an object's extended property.

Syntax

Update-ExtendedProperty [-Name] <String> [-Value] <Object> [-SchemaName <String>] -ViewName <String> -ColumnName <String> [<CommonParameters>]
Update-ExtendedProperty [-Name] <String> [-Value] <Object> [-SchemaName <String>] -ViewName <String> [<CommonParameters>]
Update-ExtendedProperty [-Name] <String> [-Value] <Object> [-SchemaName <String>] -TableName <String> -ColumnName <String> [<CommonParameters>]
Update-ExtendedProperty [-Name] <String> [-Value] <Object> [-SchemaName <String>] -TableName <String> [<CommonParameters>]
Update-ExtendedProperty [-Name] <String> [-Value] <Object> [-SchemaName <String>] [<CommonParameters>]

Description

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

Currently, this function only supports updating 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 update.

true false
Value Object

The value of the extended property.

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

Update-ExtendedProperty -Name 'Deploy' -Value 'FALSE' -SchemaName 'spike'

Sets the custom Deploy metadata to be FALSE.

EXAMPLE 2

Update-ExtendedProperty -Name 'Deploy' -Value 'FALSE' -TableName 'Food'

Sets the custom Deploy metadata to be FALSE on the Food table in the dbo schema.

EXAMPLE 3

Update-ExtendedProperty -Name 'IsEncrypted' -Value 'TRUE' -TableName 'User' -ColumnName 'Password'

Sets the custom IsEncrypted metadata to be TRUE on the User table's Password column.

EXAMPLE 4

Update-ExtendedProperty -Name 'ContainsPII' -Value 'FALSE' -View 'LoggedInUsers'

Demonstrates how to update custom metadata on the LoggedInUsers view

EXAMPLE 5

Update-ExtendedProperty -Name 'IsEncrypted' -Value 'FALSE' -View 'LoggedInUsers' -ColumnName 'Password'

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