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.
Decrypt permission denied on object <table_name>, database <database name>, owner <owner name>
select * from customer
Returns the value “****************” instead of returning the credit card data to users who lack decrypt permission.
create table table_name (column_name datatype [[encrypt [with keyname]] [decrypt_default value]], ....)
decrypt_default – specifies that this column returns a default value on a select statement for users who do not have decrypt permissions.
value – is the value SAP ASE returns on select statements instead of the decrypted value. A constant-valued expression cannot reference a database column but it can include a user-defined function which itself references tables and columns. The value can be NULL on nullable columns only, and the value must be convertible into the column’s datatype.
create table t2 (ssnum char(11) encrypt decrypt_default '???????????', ...)
alter table table_name modify column_name [type] [[encrypt [with keyname]] [decrypt_default value]], …
alter table emp modify ssn encrypt with key1 decrypt_default '000-00-0000'
alter table table_name replace column_name decrypt_default value
alter table employee replace salary decrypt_default $0.00
alter table employee replace salary decrypt_default dbo.mask_salary()
alter table table_name replace column_name drop decrypt_default
alter table employee replace salary drop decrypt_default