Installing and configuring the Optim data privacy user-defined functions for Microsoft SQL Server

The IBM® InfoSphere® Optim™ Data Privacy solution provides user-defined functions (UDFs) you can use to mask Microsoft™ SQL Server data.

The data privacy user-defined functions for SQL Server provide a set of SQL functions that can perform data masking using one of the following data privacy providers:
  • Credit Card Number (CCN)
  • Affinity (AFF)
  • National Identifier (NID)
  • Email Address (EML)
  • Age (AGE)
  • Hash (HASH)
All of the UDFs for SQL Server are scalar functions that are invoked in the same manner as the built-in scalar SQL functions (for example, SUBSTRING, RTRIM, and UPPER). The UDFs for SQL Server do not support a table UDF (UDTF).

The following tables list the names of the UDFs for masking SQL Server data and their associated input and return data types.

The UDFs in the following table support only a single data argument with the data privacy provider input syntax.
Table 1. Single-argument UDFs for SQL Server.

UDF Name Input data type Return data type Privacy provider
OptimMaskDate DATE DATE AGE
OptimMaskDouble FLOAT FLOAT AFF, HASH
OptimMaskInt64 BIGINT BIGINT AFF, CCN, HASH, NID
OptimMaskInt64Date DATE BIGINT HASH
OptimMaskInt64Double FLOAT BIGINT HASH
OptimMaskInt64NStr NVARCHAR(800) BIGINT AFF, CCN, HASH, NID
OptimMaskInt64Time TIME BIGINT HASH
OptimMaskInt64Timestamp DATETIME2 BIGINT HASH
OptimMaskNStr NVARCHAR(800) NVARCHAR(800) AFF, CCN, EML, HASH, NID
OptimMaskNum18S2 DECIMAL(18,2) DECIMAL(18,2) AFF, CCN, HASH, NID
OptimMaskNum18S4 DECIMAL(18,4) DECIMAL(18,4) AFF, CCN, HASH, NID
OptimMaskNum18S6 DECIMAL(18,6) DECIMAL(18,6) AFF, CCN, HASH, NID
OptimMaskTimestamp DATETIME2 DATETIME2 AGE
Note: 800 characters is the maximum size of an email address and the longest NVARCHAR data type that is supported. You may create custom UDFs to support other lengths.

Use the multi-argument UDFs in the following table when you have more than a single column, expression, or literal as input to the UDF.

Table 2. Multi-argument UDFs for SQL Server.

UDF Name Number of arguments Input data type Return data type Privacy provider
OptimMaskInt64NStr2 2 NVARCHAR(800) BIGINT HASH
OptimMaskInt64NStr3 3 NVARCHAR(800) BIGINT HASH
OptimMaskNStr2 2 NVARCHAR(800) NVARCHAR(800) EML, HASH
OptimMaskNStr3 3 NVARCHAR(800) NVARCHAR(800) EML, HASH
Note: It is recommended that your site's database administrator (DBA) install and configure the UDFs for SQL Server, since these tasks require operating system access to the server machine and restarting SQL Server.