UPDATE: It appears there may be some certificate or rule running on open queries with enrypted column data. I have discovered that the following produces an unencrypted value concat 'more'. I will have to verify with our DBA what may cause this behavior.
case when s.EncryptedColumn is not null then concat(s.[EncryptedColumn], ' more') else s.[RawColumn] end
I am trying to do a simple comparison to null against a varbinary(16)
column however I cannot get the result to return true.
This is what I have tried:
Attempt 1:
select
s.[EncryptedColumn],
(case when s.[EncryptedColumn] is not null
then s.[EncryptedColumn]
else s.[RawColumn]
end) as 'result'
Result 1: encrypted data, raw data
Attempt 2:
select
datalength(s.[EncryptedColumn]),
(case when datalength(s.[EncryptedColumn]) > 0
then s.[EncryptedColumn]
else s.[RawColumn]
end) as 'result'
Result 2: encrypted data length (16), raw data
Any ideas?