Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Create a Database Master Key

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

This topic describes how to create a database master key in SQL Server 2016 by using Transact-SQL.

In This Topic

Security

Permissions

Requires CONTROL permission on the database.

Arrow icon used with Back to Top link [Top]

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 Database Engine.

  3. On the Standard bar, click New Query.

  4. Copy and paste the following example into the query window and click Execute.

    -- Creates a database master key for the "AdventureWorks2012" database. 
    -- The key is encrypted using the password "23987hxJ#KL95234nl0zBe."
    USE AdventureWorks2012;
    GO
    CREATE MASTER KEY ENCRYPTION BY PASSWORD = '23987hxJ#KL95234nl0zBe';
    GO
    

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

Arrow icon used with Back to Top link [Top]

Community Additions

ADD
Show:
© 2015 Microsoft