title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CLOSE MASTER KEY (Transact-SQL) |
CLOSE MASTER KEY (Transact-SQL) |
VanMSFT |
vanto |
05/15/2017 |
sql |
t-sql |
reference |
|
|
|
>=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDE sql-asdb-asdbmi-asa-pdw]
Closes the master key of the current database.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
CLOSE MASTER KEY
Note
[!INCLUDEsynapse-analytics-od-unsupported-syntax]
[!INCLUDEsql-server-tsql-previous-offline-documentation]
Takes no arguments.
This statement reverses the operation performed by OPEN MASTER KEY. CLOSE MASTER KEY only succeeds when the database master key was opened in the current session by using the OPEN MASTER KEY statement.
No permissions are required.
USE AdventureWorks2022;
CLOSE MASTER KEY;
GO
Examples: [!INCLUDEssazuresynapse-md] and [!INCLUDEssPDW]
USE master;
OPEN MASTER KEY DECRYPTION BY PASSWORD = '43987hkhj4325tsku7';
GO
CLOSE MASTER KEY;
GO
CREATE MASTER KEY (Transact-SQL)
OPEN MASTER KEY (Transact-SQL)
Encryption Hierarchy