Skip to content

Commit ac55708

Browse files
authored
Merge pull request #18935 from WilliamDAssafMSFT/20210324-ddm-exttab
20210324 document DDM External table feature incompatibility
2 parents 6ecaa81 + d86010d commit ac55708

2 files changed

Lines changed: 26 additions & 21 deletions

File tree

docs/relational-databases/security/dynamic-data-masking.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
2-
title: "Dynamic Data Masking | Microsoft Docs"
2+
title: "Dynamic Data Masking"
33
description: Learn about dynamic data masking, which limits sensitive data exposure by masking it to non-privileged users. It can greatly simplify security in SQL Server.
4-
ms.date: "05/02/2019"
4+
ms.date: "03/24/2021"
55
ms.prod: sql
66
ms.prod_service: "database-engine, sql-database, synapse-analytics"
77
ms.reviewer: ""
88
ms.technology: security
99
ms.topic: conceptual
10-
ms.assetid: a62f4ff9-2953-42ca-b7d8-1f8f527c4d66
1110
author: VanMSFT
1211
ms.author: vanto
1312
monikerRange: "=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current"
@@ -19,7 +18,7 @@ monikerRange: "=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sq
1918

2019
Dynamic data masking (DDM) limits sensitive data exposure by masking it to non-privileged users. It can be used to greatly simplify the design and coding of security in your application.
2120

22-
Dynamic data masking helps prevent unauthorized access to sensitive data by enabling customers to specify how much sensitive data to reveal with minimal impact on the application layer. DDM can be configured on designated database fields to hide sensitive data in the result sets of queries. With DDM the data in the database is not changed. Dynamic data masking is easy to use with existing applications, since masking rules are applied in the query results. Many applications can mask sensitive data without modifying existing queries.
21+
Dynamic data masking helps prevent unauthorized access to sensitive data by enabling customers to specify how much sensitive data to reveal with minimal impact on the application layer. DDM can be configured on designated database fields to hide sensitive data in the result sets of queries. With DDM the data in the database is not changed. DDM is easy to use with existing applications, since masking rules are applied in the query results. Many applications can mask sensitive data without modifying existing queries.
2322

2423
* A central data masking policy acts directly on sensitive fields in the database.
2524
* Designate privileged users or roles that do have access to the sensitive data.
@@ -80,6 +79,8 @@ WHERE is_masked = 1;
8079
- A mask cannot be configured on a computed column, but if the computed column depends on a column with a MASK, then the computed column will return masked data.
8180

8281
- A column with data masking cannot be a key for a FULLTEXT index.
82+
83+
- A column in a PolyBase [external table](../../t-sql/statements/create-external-table-transact-sql.md).
8384

8485
For users without the **UNMASK** permission, the deprecated **READTEXT**, **UPDATETEXT**, and **WRITETEXT** statements do not function properly on a column configured for Dynamic Data Masking.
8586

@@ -116,18 +117,18 @@ It is important to properly manage the permissions on the database, and to alway
116117
```sql
117118

118119
-- schema to contain user tables
119-
CREATE SCHEMA Data
120+
CREATE SCHEMA Data;
120121
GO
121122

122123
-- table with masked columns
123124
CREATE TABLE Data.Membership(
124-
MemberID int IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,
125-
FirstName varchar(100) MASKED WITH (FUNCTION = 'partial(1, "xxxxx", 1)') NULL,
126-
LastName varchar(100) NOT NULL,
127-
Phone varchar(12) MASKED WITH (FUNCTION = 'default()') NULL,
128-
Email varchar(100) MASKED WITH (FUNCTION = 'email()') NOT NULL,
129-
DiscountCode smallint MASKED WITH (FUNCTION = 'random(1, 100)') NULL
130-
)
125+
MemberID int IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,
126+
FirstName varchar(100) MASKED WITH (FUNCTION = 'partial(1, "xxxxx", 1)') NULL,
127+
LastName varchar(100) NOT NULL,
128+
Phone varchar(12) MASKED WITH (FUNCTION = 'default()') NULL,
129+
Email varchar(100) MASKED WITH (FUNCTION = 'email()') NOT NULL,
130+
DiscountCode smallint MASKED WITH (FUNCTION = 'random(1, 100)') NULL
131+
);
131132

132133
-- inserting sample data
133134
INSERT INTO Data.Membership (FirstName, LastName, Phone, Email, DiscountCode)

docs/t-sql/statements/create-external-table-transact-sql.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The one to three-part name of the table to create. For an external table, SQL st
100100
> For best performance, if the external data source driver supports a three-part name, it is strongly recommended to provide the three-part name.
101101
102102
\<column_definition> [ ,...*n* ]
103-
CREATE EXTERNAL TABLE supports the ability to configure column name, data type, nullability and collation. You can't use the DEFAULT CONSTRAINT on external tables.
103+
CREATE EXTERNAL TABLE supports the ability to configure column name, data type, nullability, and collation. You can't use the DEFAULT CONSTRAINT on external tables.
104104

105105
The column definitions, including the data types and number of columns, must match the data in the external files. If there's a mismatch, the file rows will be rejected when querying the actual data.
106106

@@ -220,6 +220,7 @@ Constructs and operations not supported:
220220

221221
- The DEFAULT constraint on external table columns
222222
- Data Manipulation Language (DML) operations of delete, insert, and update
223+
- [Dynamic Data Masking](../../relational-databases/security/dynamic-data-masking.md) on external table columns
223224

224225
### Query limitations
225226

@@ -240,7 +241,7 @@ The following data types cannot be used in PolyBase external tables:
240241
- `text`
241242
- `nText`
242243
- `xml`
243-
- Any user defined type
244+
- Any user-defined type
244245

245246
## Locking
246247

@@ -657,7 +658,7 @@ The one to three-part name of the table to create. For an external table, SQL st
657658
> For best performance, if the external data source driver supports a three-part name, it is strongly recommended to provide the three-part name.
658659
659660
\<column_definition> [ ,...*n* ]
660-
CREATE EXTERNAL TABLE supports the ability to configure column name, data type, nullability and collation. You can't use the DEFAULT CONSTRAINT on external tables.
661+
CREATE EXTERNAL TABLE supports the ability to configure column name, data type, nullability, and collation. You can't use the DEFAULT CONSTRAINT on external tables.
661662

662663
> [!NOTE]
663664
> `Text`, `nText` and `XML` are not supported data types for columns in external tables for Azure SQL Database.
@@ -712,8 +713,9 @@ Constructs and operations not supported:
712713

713714
- The DEFAULT constraint on external table columns
714715
- Data Manipulation Language (DML) operations of delete, insert, and update
716+
- [Dynamic Data Masking](../../relational-databases/security/dynamic-data-masking.md) on external table columns
715717

716-
Only literal predicates defined in a query can be pushed down to the external data source. This is unlike linked servers and accessing where predicates determined during query execution can be used, i.e. when used in conjunction with a nested loop in a query plan. This will often lead to the whole external table being copied locally and then joined to.
718+
Only literal predicates defined in a query can be pushed down to the external data source. This is unlike linked servers and accessing where predicates determined during query execution can be used, that is, when used in conjunction with a nested loop in a query plan. This will often lead to the whole external table being copied locally and then joined to.
717719

718720
```sql
719721
\\ Assuming External.Orders is an external table and Customer is a local table.
@@ -742,7 +744,7 @@ The following data types cannot be used in PolyBase external tables:
742744
- `text`
743745
- `nText`
744746
- `xml`
745-
- Any user defined type
747+
- Any user-defined type
746748

747749
## Locking
748750

@@ -849,7 +851,7 @@ The one to three-part name of the table to create. For an external table, only t
849851
> For best performance, if the external data source driver supports a three-part name, it is strongly recommended to provide the three-part name.
850852

851853
\<column_definition> [ ,...*n* ]
852-
CREATE EXTERNAL TABLE supports the ability to configure column name, data type, nullability and collation. You can't use the DEFAULT CONSTRAINT on external tables.
854+
CREATE EXTERNAL TABLE supports the ability to configure column name, data type, nullability, and collation. You can't use the DEFAULT CONSTRAINT on external tables.
853855
854856
> [!NOTE]
855857
> `Text`, `nText` and `XML` are not supported data types for columns in external tables for Azure SQL Warehouse.
@@ -968,6 +970,7 @@ Constructs and operations not supported:
968970

969971
- The DEFAULT constraint on external table columns
970972
- Data Manipulation Language (DML) operations of delete, insert, and update
973+
- [Dynamic Data Masking](../../relational-databases/security/dynamic-data-masking.md) on external table columns
971974

972975
### Query limitations
973976

@@ -988,7 +991,7 @@ The following data types cannot be used in PolyBase external tables:
988991
- `text`
989992
- `nText`
990993
- `xml`
991-
- Any user defined type
994+
- Any user-defined type
992995
993996
## Locking
994997
@@ -1114,7 +1117,7 @@ The one to three-part name of the table to create. For an external table, Analyt
11141117
> For best performance, if the external data source driver supports a three-part name, it is strongly recommended to provide the three-part name.
11151118
11161119
\<column_definition> [ ,...*n* ]
1117-
CREATE EXTERNAL TABLE supports the ability to configure column name, data type, nullability and collation. You can't use the DEFAULT CONSTRAINT on external tables.
1120+
CREATE EXTERNAL TABLE supports the ability to configure column name, data type, nullability, and collation. You can't use the DEFAULT CONSTRAINT on external tables.
11181121

11191122
The column definitions, including the data types and number of columns, must match the data in the external files. If there's a mismatch, the file rows will be rejected when querying the actual data.
11201123
@@ -1225,6 +1228,7 @@ Constructs and operations not supported:
12251228

12261229
- The DEFAULT constraint on external table columns
12271230
- Data Manipulation Language (DML) operations of delete, insert, and update
1231+
- [Dynamic Data Masking](../../relational-databases/security/dynamic-data-masking.md) on external table columns
12281232

12291233
### Query limitations
12301234

@@ -1247,7 +1251,7 @@ The following data types cannot be used in PolyBase external tables:
12471251
- `text`
12481252
- `nText`
12491253
- `xml`
1250-
- Any user defined type
1254+
- Any user-defined type
12511255
12521256
## Locking
12531257

0 commit comments

Comments
 (0)