| title | CLOSE MASTER KEY (Transact-SQL) | Microsoft Docs | |||||
|---|---|---|---|---|---|---|
| ms.custom | ||||||
| ms.date | 03/06/2017 | |||||
| ms.prod | sql-non-specified | |||||
| ms.reviewer | ||||||
| ms.suite | ||||||
| ms.technology |
|
|||||
| ms.tgt_pltfrm | ||||||
| ms.topic | language-reference | |||||
| f1_keywords |
|
|||||
| dev_langs |
|
|||||
| helpviewer_keywords |
|
|||||
| ms.assetid | bb04ef7a-9f3a-437e-a6f9-ba0204082cb9 | |||||
| caps.latest.revision | 30 | |||||
| author | BYHAM | |||||
| ms.author | rickbyh | |||||
| manager | jhubbard |
[!INCLUDEtsql-appliesto-ss2008-all_md]
Closes the master key of the current database.
Transact-SQL Syntax Conventions
-- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse
CLOSE MASTER KEY
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 AdventureWorks2012;
CLOSE MASTER KEY;
GO
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