mercredi 15 juillet 2015

Generating the same random string in SQL for a set of rows

I am trying to 'obfuscate' data in a SQL database for the purposes of testing. I have a single field in a single table where I want the values to be replaced with a random string - however the same string has to have the same value. So for example:

Cat
Dog
Cat
Fish
Monkey

Would have to replaced with

YuW -- same
JiK
YuW -- same
IPoQ
KYiLwY

I don't want this to be reversible (so no ROT13, etc..)

EDIT: i need for it to remain the same length as well. This database will be used for performance testing purposes, and I want realistic string sizes to be used.




Aucun commentaire:

Enregistrer un commentaire