I'm working on a little project to depersonalise data in our development environment (like names, telephone numbers, prices, etc.). I have some ideas to handle this but i'm not sure if/how it could work. Maybe you can give me some tips.
Example:
table1 (firstname, lastname, emplyoeeid, office)
table2 (employeeid, phonenumber, mobilephonenumber, device, addons)
Procedure (how it should look like):
@databasename varchar (50)
@tablename varchar(50)
@attributes ???
USE DATABASE @databasename
UPDATE TABLE @tablename
SET @attributes = HASHBYTES('MD5',@attributes);
Every time I run the procedure I can choose 1 tablename and a list of attributes which I want to depersonalise. In the previous example it would be
- run1 : @tablename (table1) @attributes ('firstname', 'lastname')
- run2 : @tablename (table2) @attributes ('phonenumber', 'mobilphonenumber')
The procedure should encrypt just the attributes listed in the variable. Is it possible to implement such a procedure? How can I handle the attributes-list in a variable? Are there any smarter ways to implement this logic?
Thanks for your help.