TechNet
Export (0) Print
Expand All

CLOSE MASTER KEY (Transact-SQL)

 

THIS TOPIC APPLIES TO: yesSQL Server (starting with 2008)yesAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

Closes the master key of the current database.

Topic link icon Transact-SQL Syntax Conventions

  
CLOSE MASTER KEY  

-- Azure SQL Data Warehouse and 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

Community Additions

ADD
Show:
© 2016 Microsoft