![]() |
Data Mask SQL |
| Home | |
|
Substitute.RowNumber Sample SQL... /*=================================================================================== Mask Type: Substitute.RowNumber =====================================================================================*/ /*--------------------------------------------------------------------- Table: [dbo].[DimAccount] Column: [AccountDescription] Mask: * Type: 'Substitute: RowNum' * Params: 'Account#' * Category: 'Substitute' - overwrite all rows with a "random" value * Descrip: This mask overwrites each row with the row number. The rows are sorted on this column to derive row number. If the column data type is text-based, you can prefix the the row number with a string passed in as a parameter. ---------------------------------------------------------------------*/ UPDATE t SET t.[AccountDescription] = LEFT('Account#' + CAST(t.RowNumber AS VARCHAR(8)), 50) FROM (SELECT ROW_NUMBER() OVER (ORDER BY [AccountDescription]) AS RowNumber, * FROM [dbo].[DimAccount]) AS t |