TDE encryption in 2008 R2

  • Trying to do an if exists, but i'm not sure which table to check to see a database encryption key flag. Does anyone know?

    so I want to check if the db encryption key exists or not, than

    CREATE DATABASE ENCRYPTION KEY

    WITH ALGORITHM = AES_256

    ENCRYPTION BY SERVER CERTIFICATE TDECert

    Please help.

    So i basically want to do this:

    if not exists (select 1 from WhereIsThisFreagingDBEncryptionKey_Table?)

    BEGIN

    CREATE DATABASE ENCRYPTION KEY

    WITH ALGORITHM = AES_256

    ENCRYPTION BY SERVER CERTIFICATE TDECert

    END

  • Think this is what you are looking for..

    sys.dm_database_encryption_keys

    https://msdn.microsoft.com/en-CA/library/bb677274.aspx

  • Great, thank you! that was it.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply