To create a database protected by transparent data encryption The following procedures show you have to create a database protected by TDE using SQL Server Management Studio and by using Transact-SQL. Using SQL Server Management Studio 1. Create a database master key and certificate in the master database. 2. Create a backup of the server certificate in the master database. Etc. In transact sql:-- Create a database master key and a certificate in the master database. USE master ; GO CREATE MASTER KEY ENCRYPTION BY PASSWORD = '*rt@40(FL&dasl1'; GO CREATE CERTIFICATE TestSQLServerCert WITH SUBJECT = 'Certificate to protect TDE key' GO -- Create a backup of the server certificate in the master database. -- The following code stores the backup of the certificate and the private key file in the default data location for this instance of SQL Server -- (C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA). BACKUP CERTIFICATE TestSQLServerCert TO FILE = 'TestSQLServerCert' WITH PRIVATE KEY ( FILE = 'SQLPrivateKeyFile', ENCRYPTION BY PASSWORD = '*rt@40(FL&dasl1' ); GO Etc. ' References:https://docs.microsoft.com/en-us/sql/relational-databases/security/encryption/move-a-tde-protected-database-to-another-sql-server
To create a database protected by transparent data encryption
The following procedures show you have to create a database protected by TDE using SQL Server Management Studio and by using Transact-SQL.
Using SQL Server Management Studio
1. Create a database master key and certificate in the master database.
2. Create a backup of the server certificate in the master database.
Etc.
In transact sql:
-- Create a database master key and a certificate in the master database.
USE master ;
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '*rt@40(FL&dasl1';
GO
CREATE CERTIFICATE TestSQLServerCert
WITH SUBJECT = 'Certificate to protect TDE key'
GO
-- Create a backup of the server certificate in the master database.
-- The following code stores the backup of the certificate and the private key file in the default data location for this instance of SQL Server
-- (C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA).
BACKUP CERTIFICATE TestSQLServerCert
TO FILE = 'TestSQLServerCert'
WITH PRIVATE KEY
(
FILE = 'SQLPrivateKeyFile',
ENCRYPTION BY PASSWORD = '*rt@40(FL&dasl1'
);
GO
Etc.
'
References:
https://docs.microsoft.com/en-us/sql/relational-databases/security/encryption/move-a-tde-protected-database-to-another-sql-server