Sep 12, 2018 12:07 PM|smtaqi|LINK
I have a column [Amount] of type float in my table, I encrypted it using Always Encrypted, everything works fine I can even see plain text value if I use Column Encryption Setting=Enabled in SSMS.
Now I have a SP, I'm trying to get that encrypted column value in a variable but SSMS not letting me compile my function it says.
Encryption scheme mismatch for columns/variables '@value'. The encryption scheme for the columns/variables is (encryption_type = 'PLAINTEXT') and the expression near line '84' expects it to be (encryption_type = 'DETERMINISTIC', encryption_algorithm_name
= 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_Auto1', column_encryption_key_database_name = 'RafDB') (or weaker).
This is how I'm assigning value to variable
Declare @value AS FLOAT
SET @value = (select top 1 Amount from tbl)
Any help will be appreciated.