'Ignore case when comparing nvarchar on encrypted column

I am trying to do a filter on a table using a column named email.

This column is encrypted using a DETERMINISTIC encryption_algorithm_name AEAD_AES_256_CBC_HMAC_SHA_256. I am using a stored procedure called from a .net core application. My problem is that the comparison is not case sensitive.

I checked the collate property in information_schema.columns and it was Latin1_General_BIN2.

I tried to do the comparison with different COLLATE property(@email = Email COLLATE Latin1_General_CS_AS) or COLLATE SQL_Latin1_General_CP1_CI_AS as I saw in another post but that did not work.

I am not sure if the comparison occurs on the real or the encrypted value. Is there a way to make the comparison not case sensitive?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source