How to drop Certificate and master key from the server.
/*
Follow below process to drop certificate and
master key
*/
use master;
go
select
database_name =
d.name,
dek.encryptor_type,
cert_name =
c.name
from sys.dm_database_encryption_keys dek
left join sys.certificates c
on dek.encryptor_thumbprint =
c.thumbprint
inner join sys.databases d
on dek.database_id = d.database_id;
GO
/*
First encryption off on the respective
database
*/
USE master
go
ALTER DATABASE G
SET ENCRYPTION OFF
go
/*
drop the
encryption key from the user database
*/
use G
GO
drop database encryption key
GO
/*
drop the
certificate from master database.
*/
USE master
go
DROP CERTIFICATE MyServerCert1
/*
drop
master key from master database
*/
DROP MASTER KEY
Comments