Advertisement
Intermediate SQL Server, Transparent Data Encryption

How do you check whether Transparent Data Encryption is currently enabled on a specific database?

Short answer

You can query the sys.dm_database_encryption_keys dynamic management view, which shows the encryption state for every database on the server, letting you confirm whether TDE is actually active and functioning correctly, which is a useful verification step after initially…

Save SQL Server mock interview
Advertisement
AModel answer
You can query the sys.dm_database_encryption_keys dynamic management view, which shows the encryption state for every database on the server, letting you confirm whether TDE is actually active and functioning correctly, which is a useful verification step after initially enabling it or during a routine security audit.
SELECT DB_NAME(database_id) AS DatabaseName, encryption_state, encryption_state_desc
FROM sys.dm_database_encryption_keys;
Real-world example
A security auditor runs a query against sys.dm_database_encryption_keys across all databases on a server, quickly confirming which databases have TDE properly enabled and which ones might still need it applied as part of a compliance review.
Likely follow-ups
  • What do the different numeric encryption_state values actually mean?
  • How long does it typically take for TDE encryption to complete on a large existing database?
Related topics