Linking random data in 2 columns
rbrend
Posts: 1 New member
Not sure if this is something I can do but I'd like to link some randomly generated data together e.g. if one column is a number from 1-10 and column 2 is a letter from a-z and when generating the data a row has a '1' and a 'h' together then any other cases of a '1' in the first column should have an 'h' in the second.
I know I can do this if I have pre-existing data like a CSV by setting the seeds to be the same but can't see a way with randomly generated data.
The data is not stored in a separate table with a reference because over time there will be some exceptions to the above rule (just to be difficult), so whilst my test data should reflect the above rule I can't restrict the schema as I might ordinarily.
I know I can do this if I have pre-existing data like a CSV by setting the seeds to be the same but can't see a way with randomly generated data.
The data is not stored in a separate table with a reference because over time there will be some exceptions to the above rule (just to be difficult), so whilst my test data should reflect the above rule I can't restrict the schema as I might ordinarily.
Tagged:
Answers
Using a CSV generator will obviously help you achieve the above.
You could also use a Python Script to achieve your goal. Further reading available here in the 'Python script generator' section. There are also Python script example's for you to use as a starting point in creating your own scripts.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com