Drops an extended property for a schema, table, or column.
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>]
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!
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 |
Remove-ExtendedProperty -Name 'Deploy' -SchemaName 'spike'
Drops the custom Deploy
metadata for the spike
schema.
Remove-ExtendedProperty -Name 'Deploy' -TableName 'Food'
Drops the custom Deploy
metadata on the Food
table in the dbo
schema.
Remove-ExtendedProperty -Name 'IsEncrypted' -TableName 'User' -ColumnName 'Password'
Drops the custom IsEncrypted
metadata on the User
table's Password
column.
Remove-ExtendedProperty -Name 'ContainsPII' -View 'LoggedInUsers'
Demonstrates how to remove custom metadata on the LoggedInUsers
view
Remove-ExtendedProperty -Name 'IsEncrypted' -View 'LoggedInUsers' -ColumnName 'Password'
Demonstrates how to remove custom metadata for a view's column