您可以在此处重现该问题:
CREATE TABLE [dbo].[EmployeeDataMasking](
[RowId] [int] IDENTITY(1,1) NOT NULL,
[EmployeeId] [int] NULL,
[LastName] [varchar](50) MASKED WITH (FUNCTION = 'partial(2, "XXXX", 2)') NOT NULL,
[FirstName] [varchar](50) MASKED WITH (FUNCTION = 'partial(2, "XXXX", 2)') NOT NULL,
CONSTRAINT [PK_EmployeeDataMasking] PRIMARY KEY CLUSTERED
(
[RowId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY],
) ON [PRIMARY]
GO
Insert Into dbo.EmployeeDataMasking (EmployeeId, LastName, FirstName)
VALUES( 1,'Smithsonian','Daniel'),( 2,'Templeton','Ronald')
Select
EmployeeId,
LastName,
FirstName,
LastName + ', ' + FirstName
From dbo.EmployeeDataMasking
请注意 LastName 和 FirstName 字段被部分屏蔽(如预期的那样)。但是,组合名称字段包含默认掩码。我不知道这是否被认为是一个错误。但是,我认为组合字段将保留它包含的两个字段的掩码。至少这是我更喜欢的,因为我不知道如何为组合字段提供掩码。