Updates an object's extended property.
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>]
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!
| 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 |
Update-ExtendedProperty -Name 'Deploy' -Value 'FALSE' -SchemaName 'spike'
Sets the custom Deploy metadata to be FALSE.
Update-ExtendedProperty -Name 'Deploy' -Value 'FALSE' -TableName 'Food'
Sets the custom Deploy metadata to be FALSE on the Food table in the dbo schema.
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.
Update-ExtendedProperty -Name 'ContainsPII' -Value 'FALSE' -View 'LoggedInUsers'
Demonstrates how to update custom metadata on the LoggedInUsers view
Update-ExtendedProperty -Name 'IsEncrypted' -Value 'FALSE' -View 'LoggedInUsers' -ColumnName 'Password'
Demonstrates how to update custom metadata for a view's column