我已創建使用表: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