Masking and External Tables

grajee 346 Reputation points
2021-03-16T19:50:04.057+00:00

All,

The script below works fine on SQLServer 2019:

CREATE TABLE DefaultMask
(
ID INT   IDENTITY (1,1) PRIMARY KEY NOT NULL
,Name VARCHAR(255)  NULL
,BirthDate     DATE     NOT NULL
,Social_Security  BIGINT NOT NULL
);
GO

But the below script below gives an error. I need to setup an external table definition with data masking.

Msg 103010, Level 16, State 1, Line 1
Parse error at line: 4, column: 20: Incorrect syntax near 'MASKED'.

CREATE EXTERNAL TABLE DefaultMask
(
ID             INT              NOT NULL
,Name VARCHAR(255)  MASKED WITH (FUNCTION = 'default()') NULL
,BirthDate     DATE     MASKED WITH (FUNCTION = 'default()') NOT NULL
,Social_Security  BIGINT        MASKED WITH (FUNCTION = 'default()') NOT NULL
)WITH (DATA_SOURCE = [PolyRDM],LOCATION = N'[DataMart].[dbo].[DefaultMask]')
GO

For External Tables, are data masking not supported?

Thanks,
grajee

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,024 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,573 questions
{count} votes

1 additional answer

Sort by: Most helpful
  1. CarrinWu-MSFT 6,866 Reputation points
    2021-03-17T04:03:51.66+00:00

    Hi @grajee ,

    In an external table, data masking is not be supported. And there have some other limitations for data masking, please refer to Dynamic Data Masking to get the details. And SQL Server provide different ways to protect data, you can use another way to protect sensitive data, please refer to Protect your data at every layer to get more information.

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.