when using Secure Enclave, only direct equality is supported (if determinist encryption used), because only the encrypted values can be compared, as the server can not decrypt the stored data to do a like wildcard compare.
Issue with SQL Azure Secure Enclave: LIKE Clause Failing with Error".
I am using Microsoft SQL Azure (RTM) - 12.0.2000.8 , where I configured the secure enclave with VBS where I am using keyvalut for creating column master key. All the operators are working fine except like. Able to insert, update with where clause.
Tried with DETERMINISTIC and RANDOMIZED both encryption type.
Below code is working:
EXEC sp_describe_parameter_encryption
N'select * from test1 where gender like (@c1)',
N'@c1 varchar(10)';
Below code is failing
declare @c1 varchar(10)='%Male%'
select Name from test1 where gender like @c1
error:
An error occurred while executing batch. Error message is: Error occurred when reading 'sp_describe_parameter_encryption' resultset. Attestation URL has not been specified in the connection string, but the query requires enclave computations. Enclave type is 'VBS'.
Note: I have used all types of datatype for the column/variable as nvarchar,varchar,char
SQL Server Transact-SQL
2 answers
Sort by: Most helpful
-
Bruce (SqlWork.com) 77,476 Reputation points Volunteer Moderator
2025-06-05T16:22:40.1+00:00 -
Erland Sommarskog 121.3K Reputation points MVP Volunteer Moderator
2025-06-06T16:02:51.48+00:00 I was able to reproduce the error. It is another setting that is wrong. You need to set Attestation Protocol to None. When I left it as "Not specified" I got the same error as you.