Skip to content

Instantly share code, notes, and snippets.

@algonzalez
Forked from sbjustin/gist:5404228
Last active August 29, 2015 14:14
Show Gist options
  • Save algonzalez/4156a2b8ca6f71893dae to your computer and use it in GitHub Desktop.
Save algonzalez/4156a2b8ca6f71893dae to your computer and use it in GitHub Desktop.
select
database_id as 'Database ID', name as 'Database Name',
CASE encryption_state
WHEN 0 THEN 'No database encryption key present, no encryption'
WHEN 1 THEN 'Unencrypted'
WHEN 2 THEN 'Encryption in progress'
WHEN 3 THEN 'Encrypted'
WHEN 4 THEN 'Key change in progress'
WHEN 5 THEN 'Decryption in progress'
WHEN 6 THEN 'Protection change in progress'
END as Status
from
sys.dm_database_encryption_keys e
join
sys.sysdatabases d
on
e.database_id = d.dbid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment