Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Technical Reference
 BACKUP MASTER KEY (Transact-SQL)
Community Content
In this section
Statistics Annotations (0)
Other versions are also available for the following:
SQL Server 2008 Books Online (December 2008)
BACKUP MASTER KEY (Transact-SQL)

Exports the database master key.

Topic link icon Transact-SQL Syntax Conventions

BACKUP MASTER KEY TO FILE = 'path_to_file' 
    ENCRYPTION BY PASSWORD = 'password'
FILE = 'path_to_file'

Specifies the complete path, including file name, to the file to which the master key will be exported. This may be a local path or a UNC path to a network location.

PASSWORD = 'password'

Is the password used to encrypt the master key in the file. This password is subject to complexity checks. For more information, see Password Policy.

The master key must be open and, therefore, decrypted before it is backed up. If it is encrypted with the service master key, the master key does not have to be explicitly opened. But if the master key is encrypted only with a password, it must be explicitly opened.

We recommend that you back up the master key as soon as it is created, and store the backup in a secure, off-site location.

Requires CONTROL permission on the database.

The following example creates a backup of the AdventureWorks master key. Because this master key is not encrypted by the service master key, a password must be specified when it is opened.

USE AdventureWorks;
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'sfj5300osdVdgwdfkli7';
BACKUP MASTER KEY TO FILE = 'c:\temp\exportedmasterkey' 
    ENCRYPTION BY PASSWORD = 'sd092735kjn$&adsg';
GO 
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker