Skip to content

Commit 96319d8

Browse files
authored
Update tde-check-status.sql
1 parent d173081 commit 96319d8

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
SELECT
2-
DB_NAME(database_id) AS DatabaseName,
1+
SELECT
2+
DB_NAME(database_id) AS DatabaseName,
33
encryption_state,
4-
encryption_state_desc = CASE encryption_state
5-
WHEN '0' THEN 'No database encryption key present, no encryption'
6-
WHEN '1' THEN 'Unencrypted'
7-
WHEN '2' THEN 'Encryption in progress'
8-
WHEN '3' THEN 'Encrypted'
9-
WHEN '4' THEN 'Key change in progress'
10-
WHEN '5' THEN 'Decryption in progress'
11-
WHEN '6' THEN 'Protection change in progress (The certificate or asymmetric key that is encrypting the database encryption key is being changed.)'
12-
ELSE 'No Status'
13-
END,
4+
encryption_state_desc =
5+
CASE encryption_state
6+
WHEN '0' THEN 'No database encryption key present, no encryption'
7+
WHEN '1' THEN 'Unencrypted'
8+
WHEN '2' THEN 'Encryption in progress'
9+
WHEN '3' THEN 'Encrypted'
10+
WHEN '4' THEN 'Key change in progress'
11+
WHEN '5' THEN 'Decryption in progress'
12+
WHEN '6' THEN 'Protection change in progress (The certificate or asymmetric key that'
13+
+ ' is encrypting the database encryption key is being changed.)'
14+
ELSE 'No Status' END,
1415
percent_complete,
15-
encryptor_thumbprint,
16-
encryptor_type
17-
FROM sys.dm_database_encryption_keys
16+
certificate_name = (SELECT name
17+
FROM master.sys.certificates AS c
18+
WHERE c.thumbprint = a.encryptor_thumbprint),
19+
encryptor_thumbprint,
20+
encryptor_type
21+
FROM sys.dm_database_encryption_keys a

0 commit comments

Comments
 (0)