Remove-SqlColumnEncryptionKeyValue

Removes an encrypted value from an existing column encryption key object in the database.

Syntax

Remove-SqlColumnEncryptionKeyValue
      -ColumnMasterKeyName <String>
      [-Name] <String>
      [-InputObject] <Database>
      [-Script]
      [<CommonParameters>]
Remove-SqlColumnEncryptionKeyValue
      -ColumnMasterKeyName <String>
      [-Name] <String>
      [[-Path] <String>]
      [-Script]
      [<CommonParameters>]

Description

The Remove-SqlColumnEncryptionKeyValue cmdlet modifies a column encryption key object in the database, by removing an entry for an encrypted value produced using the specified column master key.

Examples

Example 1: Remove a column encryption key value

PS C:\> CD SQLSERVER:\SQL\MyServer\MyInstance\Databases\MyDatabase
PS SQLSERVER:\SQL\MyServer\MyInstance\Databases\MyDatabase> Remove-SqlColumnEncryptionKeyValue -Name "CEK1" -ColumnMasterKey "CMK1"

This command removes the column encryption key value encrypted with a column master key named CMK1 from the column encryption key database object named CEK1. The operation happens on database MyDatabase on server instance MyServer\MyInstance

Parameters

-ColumnMasterKeyName

Specifies the name of the column master key that was used to produce the encrypted value that this cmdlet removes.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies the SQL database object for which this cmdlet runs the operation.

Type:Database
Position:2
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of the column encryption key object that this cmdlet removes.

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Path

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

Type:String
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Script

Indicates that this cmdlet returns a Transact-SQL script that performs the task that this cmdlet performs.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.SqlServer.Management.Smo.Database