encryption - How to optimize convertions in encrypted SQL Server database table -
i have encrypted database table , want select data calculations. lot of conversions needed , encrypt again update table. how can optimize query. sample query
select @total=cast(convert(varchar, decryptbykey([amount1])) numeric(12, 2))+ cast(convert(varchar, decryptbykey([amount2])) numeric(12, 2))*@percent table1 update table1 set [total]= encryptbykey(key_guid('key_67832'), convert(varchar,@total))
select cast(convert(varchar, decryptbykey([amount1])) numeric(12, 2)) amount1, primarykey -- not sure if need this, added in case... temptable table1 select @total=amount1 + amount1 * @percent temptable -- bit unchanged (so far) update table1 set [total]= encryptbykey(key_guid('key_67832'), convert(varchar,@total))
Comments
Post a Comment