dbd_import_keys

exec dbd_import_keys

This function is automatically created in encrypted database at the moment of encryption. The database must be initially unlocked with OPEN SYMMETRIC KEY DBDX statement. Call this procedure in the context of encrypted database.

dbd_import_keys imports encryption keys to local storage using Windows Data Protection API and deletes .dbd_key files. Resulting files are not transferable to another computer or to another Windows account. If you change account for SQL Server service the database will be unavailable.

By default, DbDefence creates exportable keys in the same folder with database data and log files. Key files have .DBD_KEY extension.

Return Code Values

0 for success otherwise failure

Example

  
use [mydatabase]
open symmetric key dbdx decryption by password='MyPass'
exec dbd_import_keys

Remarks

To export keys run dbd_export_keys.