I need to update a column using an encrypted column value after insert using a trigger. I need to get encrypted inserted column value and update other column using its value
I try below.
Declare @value vachar(16) = (select encyptedColumn from inserted) and get below error
Encryption scheme mismatch for columns/variables '@value'. The encryption scheme
for the columns/variables is (encryption_type = 'PLAINTEXT') and the expression near
line '2' expects it to be (encryption_type = 'DETERMINISTIC', encryption_algorithm_name
= 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'ColumnKey',
column_encryption_key_database_name = 'MyDb') (or weaker).
but this works
Declare @value vachar(16) = '1234567890123456'
How can i get encrypted value and set it to a variable? without hardcoding it.