Posts

Showing posts with the label data

Data scrubbing using SQL functions for SQL Server

Many a times, it is required to scrub the data before it is used in development environments as the data may be sensitive and cannot be shared with the vendors. The  below SQL functions can be used to scrub the data. --Creating the User defined function    CREATE FUNCTION getRandomText(@sLength TINYINT)   RETURNS VARCHAR(10)   AS                 BEGIN                  DECLARE @counter TINYINT                  DECLARE @nextChar CHAR(1)                  DECLARE @randomString VARCHAR(50)                    SET @sLength=10                  SET @counter = 1                  SET @randomString = ''              ...