Additional SQL Server features and topics not covered by specific categories
You could also use the HASHBYTES function to produce your masked values.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I would like to check for data masking solution when reading data from a SQL Server database.
To elaborate further, the data elements should be encrypted/masked when a set of users querying the tables. The data stored at rest should be clear (i.e. unmasked/ not encrypted).
Also, the masking values should be consistent(deterministic) across the database. E.g. if a username john - masked/encrypted to xyz in schema 1 table a, schema 2 table b should have the same masked/encrypted value for the same user. So that we can join the cross-schema tables.
Key notes:
I have explored the SQL Server TDE & DDE options but doesn't suit my requirements.
Would like to hear from experts who handled such a requirement in a SQL Server database.
Thanks in advance!
Additional SQL Server features and topics not covered by specific categories
Answer accepted by question author
You could also use the HASHBYTES function to produce your masked values.
How about encrypting data by using a symmetric key.
See these docs: ENCRYPTBYKEY (Transact-SQL); CREATE SYMMETRIC KEY (Transact-SQL)
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".