Sample for use of Dynamic Data Masking in WideWorldImporters
This script demonstrates the use of Dynamic Data Masking to mask sensitive data for certain users.
Contents
About this sample
Before you begin
Running the sample
Sample details
Disclaimers
Related links
About this sample
- Applies to: SQL Server 2016 (or higher), Azure SQL Database
- Key features: Dynamic Data Masking
- Workload: OLTP
- Programming Language: T-SQL
- Author: Rick Davis
- Update history: 20 October 2016 - initial revision
Before you begin
To run this sample, you need the following prerequisites.
Software prerequisites:
- SQL Server 2016 (or higher) or Azure SQL Database.
- With SQL Server, make sure SQL authentication is enabled.
- SQL Server Management Studio
- The WideWorldImporters database.
Running the sample
-
Open the script DemonstrateDDM.sql in Management Studio and connect to the WideWorldImporters database.
-
Follow the instructions in the script.
Sample details
The WideWorldImporters sample database leverages Dynamic Data Masking to mask sensitive banking data in the table 'Purchasing.Suppliers'.
When connecting to the database and running a query using a privileged user such as the database owner, you will see the sensitive data in the clear.
The user 'GreatLakesSales' is an example unprivileged user, and will only see the masked values.
Disclaimers
The code included in this sample is not intended to be used for production purposes.
Related Links
For more information, see these articles: