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

Popular posts from this blog

iis - ASP.Net Core CreatedAtAction in HttpPost action returns 201 but entire request ends with 500 -

gcc - Neither ld wrap nor LD_PRELOAD working to intercept system call -

ssh - Vagrant Windows - ssh_exchange_identification: read: Connection reset by peer -