Create a Database Master Key
Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW)
This topic describes how to create a database master key in SQL Server by using Transact-SQL.
Security
Permissions
Requires CONTROL permission on the database.
Using Transact-SQL
To create a database master key
Choose a password for encrypting the copy of the master key that will be stored in the database.
In Object Explorer, connect to an instance of Database Engine.
Expand System Databases, right-click
master
and then click New Query.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).
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho