SQL Server - How to scramble the database in sqlserver

Asked By srujan on 05-Oct-16 06:46 PM
I want to scramble the data in sql server by creating an utility. Can anybody please help me.
Robbe Morris replied to srujan on 05-Oct-16 10:04 AM
scramble the database?  Can you elaborate?  Encryption?
srujan replied to Robbe Morris on 06-Oct-16 02:10 AM
Hi Robbe,

Thank you for the reply. I need to scramble some particular columns in a table. If we restore production Database to QA environment, i need to change the data for particular columns like FirstName, LastName and other secured information. I need to update all the secured data with some other info.

Robbe Morris replied to srujan on 06-Oct-16 09:58 AM
A quick an easy way for most string oriented columns would be to update the column:

  update MyTable
   Set FirstName = 'First Name ' + cast(MyPrimaryKeyColumn as varchar(50))
    where blah blah blah

This will ensure you can see data in the UI, know what the column values are, and not violate any unique constraints or indexes.