Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.71 KB

File metadata and controls

52 lines (38 loc) · 1.71 KB
title Create a Database Master Key | Microsoft Docs
ms.custom
ms.date 09/12/2019
ms.prod sql-server-2014
ms.reviewer carlrab
ms.technology security
ms.topic conceptual
helpviewer_keywords
database master key [SQL Server], creating
ms.assetid 8cb24263-e97d-4e4d-9429-6cf494a4d5eb
author jaszymas
ms.author jaszymas
manager craigg

Create a Database Master Key

This topic describes how to create a database master key in the master database in [!INCLUDEssCurrent] by using [!INCLUDEtsql].

In This Topic

Before You Begin

Security

Permissions

Requires CONTROL permission on the database.

Using Transact-SQL

To create a database master key

  1. Choose a password for encrypting the copy of the master key that will be stored in the database.
  2. In Object Explorer, connect to an instance of [!INCLUDEssDE].
  3. Expand System Databases, right-click master and then click New Query.
  4. Copy and paste the following example into the query window and click Execute.
-- Creates the master key.
-- The key is encrypted using the password "23987hxJ#KL95234nl0zBe."
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '23987hxJ#KL95234nl0zBe';

For more information, see CREATE MASTER KEY (Transact-SQL).