Making dynamic data masking conditional

hriday sharma 21 Reputation points
2021-02-12T07:25:29.103+00:00

My question may not be valid but is there any way to switch off dynamic data masking in runtime. I want to use same user for updating records.
I want to use on conditional basis. I need to select unmasked records for update & masked data for report. I this possible with same SQL user?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,149 questions
0 comments No comments
{count} votes

Accepted answer
  1. CathyJi-MSFT 22,326 Reputation points Microsoft Vendor
    2021-02-15T08:46:03.077+00:00

    Hi @hriday sharma ,

    > My question may not be valid but is there any way to switch off dynamic data masking in runtime.

    No, you can’t.

    Creating a mask on a column does not prevent updates to that column. So although users receive masked data when querying the masked column, the same users can update the data if they have write permissions. A proper access control policy should still be used to limit update permissions.

    Please refer to Dynamic Data Masking.


    If the response is helpful, please click "Accept Answer" and upvote it, thank you.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Erland Sommarskog 113.6K Reputation points MVP
    2021-02-12T23:02:42.02+00:00

    No, because data masking is a security feature. That is, if you don't have the permission, you cannot see what is behind that data mask.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.