使用新的AlwaysEncrypted功能,我在其中一个表中加密了DateTime列,这是我在尝试插入新日期时遇到的错误:
Message: [SqlException: Operand type clash: datetime2(7) encrypted with (encryption_type = 'RANDOMIZED', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_Auto1', column_encryption_key_database_name = 'TestDb') is incompatible with datetime encrypted with (encryption_type = 'RANDOMIZED', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'CEK_Auto1', column_encryption_key_database_name = 'TestDb') Statement(s) could not be prepared.]
我也遇到了字符串的插入错误,但是在将数据类型从 varchar(24) (例如)更改为nvarchar(max)之后,一切都很顺利。有什么建议么?