Please help me in fixing the below query in SQL Sever 2016 where columns FIRST_NAME, LAST_NAME are always encrypted.
SELECT * FROM MY_TABLE
WHERE (LAST_NAME LIKE '%[@,#,$,%,*]%' OR LAST_NAME LIKE '%,%')
OR (FIRST_NAME LIKE '%[@,#,$,%,*]%' OR FIRST_NAME LIKE '%,%');
I am getting the below error as the columns are always encrypted and also I can't declare a variable and assign the string to it.
Msg 206, Level 16, State 2, Line 1
Operand type clash: varchar(50) encrypted with (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_POC_CERTSTORE', column_encryption_key_database_name = 'UIM-LOCAL-DB') collation_name = 'Latin1_General_BIN2' is incompatible with varchar