我已创建使用表:SQL Server 2016 - 是否可以连接两个nvarchar始终加密的列?
create table dbo.employee(firstname nvarchar(100) null,lastname nvarchar(100) null)
使用插入一些样品数据:
insert into dbo.employee values('Sachin','Tendulkar')
insert into dbo.employee values('Rohit','Sharma')
insert into dbo.employee values('Virendra','Sehwag')
insert into dbo.employee values('Irfan','Pathan')
然后我用总是加密的向导来加密使用SSMS V17该表的两列。现在我试图来连接姓与名字是这样的:
select concat(firstname, lastname) from dbo.employee
而且它给我下面的错误:
Operand type clash: nvarchar(100) encrypted with (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'SampleDB_CEK', column_encryption_key_database_name = 'SampleDB') is incompatible with varchar
当我试试这个:
select firstname + lastname from dbo.employee
它提供了以下错误:
Encryption scheme mismatch for columns/variables 'firstname', 'lastname'. The encryption scheme for the columns/variables is (encryption_type = 'DETERMINISTIC', encryption_algorithm_name = 'AEAD_AES_256_CBC_HMAC_SHA_256', column_encryption_key_name = 'SampleDB_CEK', column_encryption_key_database_name = 'SampleDB') and the expression near line '1' expects it to be (encryption_type = 'PLAINTEXT') (or weaker).
任何帮助表示赞赏。
希望它是(将encryption_type = 'PLAINTEXT')(或较弱的)。那信息不够吗? – user6144226