use master
create master key encryption by password = 'xxxxx';
select * from sys.symmetric_keys
create certificate myTestCert with subject = 'MyTestCertificate'
select * from sys.certificates
use dbTest2
create database encryption key
with algorithm = aes_256
encryption by server certificate [myTestCert]
alter database dbTest2 set encryption on
use master
go
create master key encryption by password = 'CatDog12'
go
create certificate SQL03_tde with subject = 'SQL_03 TDE'
go
use MyData
go
create database encryption key with algorithm = AES_128
encryption by server certificate SQL03_tde
go
alter database MyData set encryption on
go
use master
go
backup certificate SQL03_tde
to file = 'C:\Backups\TDE\sql03cert'
with private key (file='C:\Backups\TDE\sql03CertKey', encryption by password='xxxx')