0

I using a SQL Server database with the Always Encrypted features. When I try to insert a row, it fails and throws an error

let request = new Request(`INSERT INTO [dbo].[table_name] ([Name])
                           VALUES ('test')`,
                function (err, rowCount, rows) {
                    if (err) {
                        console.log('errr--', err);
                    } else {
                        console.log(' row(s) ', rows);
                    }
                });

Error:

RequestError: Operand type clash: varchar is incompatible with varchar(8000) encrypted with (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_Auto1', column_encryption_key_database_name = 'DrugstoreDB') collation_name = 'SQL_Latin1_General_CP1_CI_AS'_```

Where is the problem?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

AlwaysEncrypted is client-side encryption, so must be supported by your client driver. AFAIK the current list of client libraries that have implemented AlwaysEncrypted is:

-SqlClient for .NET Framework (but not .NET Core/.NET Standard)

-Microsoft ODBC Driver for SQL Server for Windows

-Microsoft ODBC Driver for SQL Server for Linux

-Microsoft JDBC Driver for SQL Server

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67