Defining a decrypt default

The decrypt_default parameter for create table and alter table allows an encrypted column to return a user-defined value when a user without decrypt permission attempts to select information from the encrypted column. This avoids error message 10330:

Decrypt permission denied on object <table_name>, 
database <database name>, owner <owner name>

Using decrypt defaults on encrypted columns allows existing reports to run to completion without error, and allows users to continue seeing the information that is not encrypted. For example, if the customer table contains the encrypted column creditcard, you can design the table schema so that:

select * from customer

Returns the value “****************” instead of returning the credit card data to users who lack decrypt permission.

Adding and removing a decrypt default

These examples show how to add and remove decrypt defaults from tables.