Remove-SqlSensitivityClassification

Remove the sensitivity label and/or information type of columns in the database.

语法

ByContext (默认值)

Remove-SqlSensitivityClassification
    -ColumnName <String[]>
    [-SuppressProviderContextWarning]
    [<CommonParameters>]

ByConnectionString

Remove-SqlSensitivityClassification
    -ColumnName <String[]>
    -ConnectionString <String>
    [<CommonParameters>]

ByConnectionParameters

Remove-SqlSensitivityClassification
    -ColumnName <String[]>
    -ServerInstance <PSObject>
    -DatabaseName <String>
    [-Credential <PSCredential>]
    [<CommonParameters>]

ByPath

Remove-SqlSensitivityClassification
    -ColumnName <String[]>
    -Path <String>
    [<CommonParameters>]

ByDBObject

Remove-SqlSensitivityClassification
    -ColumnName <String[]>
    -InputObject <Database>
    [<CommonParameters>]

说明

The Remove-SqlSensitivityClassification cmdlet removes the sensitivity label and information type of columns in the database.

The sensitivity labels and information types of columns can be set using SQL Server Management Studio (SSMS) release 17.5 and above, or with the Set-SqlSensitivityClassification cmdlet.

The sensitivity labels and information types of columns can be viewed using SQL Server Management Studio (SSMS) release 17.5 and above, the Extended Properties catalog view, or the Get-SqlSensitivityClassification cmdlet.

Module requirements: version 21+ on PowerShell 5.1; version 22+ on PowerShell 7.x.

示例

Example 1: Remove sensitivity label and information type from a column using Windows authentication

PS C:\> Remove-SqlSensitivityClassification -ServerInstance "MyComputer\MainInstance" -Database "myDatabase" -ColumnName "Sales.Customers.email"

Remove the sensitivity label and information type of column Sales.Customers.email in myDatabase.

Example 2: Remove sensitivity label and information type from a column by providing a database path

PS C:\> Remove-SqlSensitivityClassification -Path "SQLSERVER:\SQL\MyComputer\MainInstance\Databases\MyDatabase" -ColumnName "Sales.Customers.email"

Remove the sensitivity label and information type of column Sales.Customers.email in MyDatabase.

Example 3: Remove sensitivity labels and information types on multiple columns using current path context

PS C:\> $columns = @("Sales.Customers.ip_address" , "Sales.Customers.email")
PS C:\> Set-Location "SQLSERVER:\SQL\MyComputer\MainInstance\Databases\MyDatabase"
PS SQLSERVER:\SQL\MyComputer\MainInstance> Remove-SqlSensitivityClassification -ColumnName $columns
 WARNING: Using provider context. Server = MyComputer, Database = MyDatabase.

Remove the sensitivity labels and information types of columns Sales.Customers.ip_address and Sales.Customers.email in MyDatabase.

参数

-ColumnName

Name(s) of columns for which information type and sensitivity label is fetched.

参数属性

类型:

String[]

默认值:None
支持通配符:False
不显示:False
别名:Column

参数集

(All)
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ConnectionString

Specifies a connection string to connect to the database. If this parameter is present, other connection parameters will be ignored

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

ByConnectionString
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Credential

Specifies a credential used to connect to the database.

参数属性

类型:PSCredential
默认值:None
支持通配符:False
不显示:False

参数集

ByConnectionParameters
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-DatabaseName

Specifies the name of a database. This cmdlet connects to this database in the instance that is specified in the ServerInstance parameter.

If the DatabaseName parameter is not specified, the database that is used depends on whether the current path specifies both the SQLSERVER:\SQL folder and a database name. If the path specifies both the SQL folder and a database name, this cmdlet connects to the database that is specified in the path.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

ByConnectionParameters
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-InputObject

Specifies a SQL Server Management Object (SMO) that represent the database that this cmdlet uses.

参数属性

类型:Database
默认值:None
支持通配符:False
不显示:False

参数集

ByDBObject
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Path

Specifies the path to the instance of SQL Server on which this cmdlet runs the operation. If you do not specify a value for this parameter, the cmdlet uses the current working location.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

ByPath
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ServerInstance

Specifies either the name of the server instance (a string) or SQL Server Management Objects (SMO) object that specifies the name of an instance of the Database Engine. For default instances, only specify the computer name: MyComputer. For named instances, use the format ComputerName\InstanceName.

参数属性

类型:PSObject
默认值:None
支持通配符:False
不显示:False

参数集

ByConnectionParameters
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-SuppressProviderContextWarning

Indicates that this cmdlet suppresses the warning that this cmdlet has used in the database context from the current SQLSERVER:\SQL path setting to establish the database context for the cmdlet.

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

ByContext
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

输入

System.String

Microsoft.SqlServer.Management.Smo.Database

输出

System.Object