locked
Reg: How To achieve the Dynamic Data Masking In SQL Server by Using the Threshold Value on the Particular Column... RRS feed

  • Question

  • Hi Experts,

    I need to have the dynamic masking on the Particular column of the table based on the threshold value.

    for example if my table structure is like

    create table TBL1

    (

    col1 int,

    col2 int,

    );

    if my threshold value is 10 on the col1 ,then all the values exist below 10 in the TBL1 are being masked by * in select statement.same should be applicable in col2 if i have the threshold configuration on Col2.

    HOW can i achive this? currently i am using the SQL Server 2016 Version in my Project.

    Thanks in Advance.

     


    Friday, September 21, 2018 10:58 AM

All replies

  • MASKED WITH (FUNCTION = 'partial(0, "XXXXXXXXXXX", 2)') NULL

    only last 2 digits will be displaye


    Ramesh Babu Vavilla MCTS,MSBI

    Friday, September 21, 2018 11:53 AM
  • Hi Babu,

    thank you for your reply.

    can i apply filter condition like only specified rows will be masked in this ?

    Thanks.

    Friday, September 21, 2018 12:38 PM
  • No, Dynamic Data Masking is not that dynamic. ("Dynamic" in this context means that the data is masked at run time, which is opposed to static data masking where the source data is masked persistently, that is destroyed.) If that is your mean, you will need to roll your own.

    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Proposed as answer by Teige Gao Tuesday, September 25, 2018 8:40 AM
    Friday, September 21, 2018 2:41 PM