USE master
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'MasterKeyPassword10?'
GO
CREATE CERTIFICATE TDECert WITH SUBJECT = 'TDE Certificate'
GO

USE testDB2
GO
CREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_256 ENCRYPTION BY SERVER CERTIFICATE TDECert
GO
ALTER DATABASE testDB2 SET ENCRYPTION ON
GO