Stored Procedure Accelerator Guide for Microsoft SQL Server

Stored Procedure Accelerator Guide for Microsoft SQL Server

Stored Procedure Accelerator Example

Stored Procedure Accelerator Example

You want to mask data called by a stored procedure.
You have a stored procedure named Proc_Dept_Emp. The stored procedure calls the following columns in the Dept_Emp table:
  • EMPLOYEE_ID
  • Last_Name
  • FIRST_NAME
  • JOB_ID
  • Job_Title
  • SALARY
  • COMM
  • DEPARTMENT_ID
You set up the stored procedure accelerator and create a masking rule set. You have a masking rule that masks the Proc_Dept_Emp stored procedure. The following table describes the columns and masking functions that you define in the masking rule:
Column
Masking Function
.*SALARY
999
.*COMM
substring(convert(varchar,\(col),0),1,1)
.*Last_Name
substring(\(col),1,2)
When you create the masking rule, you must enter the column name preceded by .*, as in the table.
You send the following request to the database:
EXEC Proc_Dept_Emp @manager_id = 25 , @dept_id = 10
The Dynamic Data Masking Java Action converts the request to the following statement:
SELECT EMPLOYEE_ID, Last_Name,FIRST_NAME,JOB_ID,Job_Title,SALARY,COMM, DEPARTMENT_ID FROM DDM_Proc_Dept_Emp_1381918459930_1
The name of the table is the table that Dynamic Data Masking created in the TempDb database.
The masking rule then changes the request to the following statement:
SELECT EMPLOYEE_ID, SUBSTRING(Last_Name,1,2) AS Last_Name, FIRST_NAME,JOB_ID,Job_Title,999 AS SALARY, substring(convert(varchar,COMM,0),1,1) AS COMM, DEPARTMENT_ID FROM DDM_Proc_Dept_Emp_1381918459930_1
Dynamic Data Masking sends the modified statement to the TempDb database table and returns masked results.

0 COMMENTS

We’d like to hear from you!