Issue with SQL Azure Secure Enclave: LIKE Clause Failing with Error".

Ashish Singhal 0 Reputation points
2025-06-05T09:44:00.5466667+00:00

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
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
197 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,476 Reputation points Volunteer Moderator
    2025-06-05T16:22:40.1+00:00

    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.

    https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/always-encrypted-enclaves?view=sql-server-ver17


  2. 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.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.