Skip to content

Commit ead93f0

Browse files
Update configure-column-encryption-using-powershell.md (#33932)
--------- Co-authored-by: Masha Thomas (MSFT) <[email protected]>
1 parent e218789 commit ead93f0

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

docs/relational-databases/security/encryption/configure-column-encryption-using-powershell.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,22 @@ for($i=0; $i -lt $tables.Count; $i++){
161161
# Decrypt all columns.
162162
Set-SqlColumnEncryption -ColumnEncryptionSettings $ces -InputObject $database -LogFileDirectory . -KeyVaultAccessToken $keyVaultAccessToken
163163
```
164-
164+
165+
## Post encryption
166+
167+
Clear the plan cache for all batches and stored procedures that access the table to refresh parameters encryption information.
168+
169+
```sql
170+
ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE;
171+
```
172+
173+
> [!NOTE]
174+
> If you don't remove the plan for the impacted query from the cache, the first execution of the query after encryption might fail.
175+
>
176+
> Use `ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE` or `DBCC FREEPROCCACHE` to clear the plan cache carefully, as it can result in temporary query performance degradation. To minimize the negative impact of clearing the cache, you can selectively remove the plans for only the impacted queries.
177+
178+
Call [sp_refresh_parameter_encryption](../../system-stored-procedures/sp-refresh-parameter-encryption-transact-sql.md) to update the metadata for the parameters of each module (stored procedure, function, view, trigger) that are persisted in [sys.parameters](../..//system-catalog-views/sys-parameters-transact-sql.md) and might have been invalidated by encrypting the columns.
179+
165180
## Next Steps
166181
- [Develop applications using Always Encrypted](always-encrypted-client-development.md)
167182

0 commit comments

Comments
 (0)