Data Mask SQL

 
 

Transform.DateVariance

Sample SQL...

/*===================================================================================
 Mask Type: Transform.DateVariance =====================================================================================*/
/*---------------------------------------------------------------------
Table: [dbo].[DimCustomer]
Column: [DateFirstPurchase]
Mask:
* Type: 'Transform: DateVariance...'
* Params: '91'
* Category: 'Transform' - Overwrite all rows with an "obsfucated" original value
* Descrip: This mask transforms each row by randomly adjusting the date value up
           or down by the number of days specified in the parameter.
---------------------------------------------------------------------*/
UPDATE [dbo].[DimCustomer]
SET [DateFirstPurchase]
  = DATEADD(DAY
      , ((CAST(ABS(CHECKSUM(NEWID())) AS FLOAT) / 2147483648) * 91 * 2 - 91)
      , [DateFirstPurchase]); 

 

eXTReMe Tracker