I have situation where I need to create a view which will be used by end user who may have PII and NON-PII permission clearance controlled by AD groups.
Say i have dim_customer which contains four columns ID, Name, DoB, Country. When PII user runs
Select ID, Name, DoB, Country FROM dim_customer
the pii user should get
ID NAME DoB Country
1 John 1999-10-10 US
If the same query is run by NON-PII user then they should get
ID NAME DoB Country
1 PII DATA PII DATA US
So basically same view object is used but data is displayed according to the pii clearance.
- I dont want to create two views with pii and non-pii suffix.
- I tried column level permission but that means when end user try the above query they get error "no select permission on Name and DoB Columns"
- I have tried Data Masking but that shows "XXXX" and i would prefer "PII Data".
I am looking for a solution where the query runs successfully and show results as above.
Is this possible in SQL Server ?
thanks in advance