SQLTeam.com | Weblogs | Forums

Hiding some columns for some users in select query

Hi

I have an alumni details table.
Here i want to hide some details of some users (may be contact details, mobile number , email , photo)from other members. Some members may wish to show all details.
How to do that. Please suggest any idea

my table includes

Id
Name
Address
City
State
Country
PhoneNo
MobileNo
EmailId
YrOfPassing
Designation
OrgName
OrgAddress
.................

create a VIEW

in the view select only some columns ( leave the columns you do not want the others to see )

depends on which version of SQL you are using. 2016 and above, you can use Dynamic Data Masking

How are they viewing the data? Via an application or a report or ?