sql server - how to add mask to your table


There are the ways we can mask our SQL server database column:- 

ALTER TABLE [Employee] ALTER COLUMN [SocialSecurityNumber]
ADD MASKED WITH (FUNCTION = 'Partial(0,"XXX-XX-", 2)')

-- Default email masking
ALTER TABLE [EMPLOYEE] ALTER COLUMN [EMAIL]
ADD MASKED WITH (FUNCTION = 'EMAIL()')

-- Using a random masking and value will be different
ALTER TABLE [EMPLOYEE] ALTER COLUMN [SALARY[
ADD MASKED WITH (FUNCTION = 'RANDOM(1,20000)')


 And we can allow visibility by running this command 

GRANT UNMASK TO DataOfficer




Comments

Popular posts from this blog

vllm : Failed to infer device type

android studio kotlin source is null error

gemini cli getting file not defined error