Is there any way to build intelligence into how data is assigned in columns ?
Dale_MFM
Posts: 1 New member
I have for example, tables that are many to one configuration. I would like the name columns, etc. to be cognizant to the primary keys and only change when the keys do. Also, I was wondering how to make information aware of, for example I have First name, Last Name, Middle Initial, and a Full Name column. How do i make the columns all work together when i need to change the names, etc. instead of having different names that don't match.
Tagged:
Answers
Hi @Dale_MFM,
Thanks for reaching out on the Redgate forums.
There are some methods to utilize data in other columns when running Data Generator.
https://documentation.red-gate.com/sdg4/using-generators/creating-new-generators
https://documentation.red-gate.com/sdg4/using-generators/example-python-scripts
I've spun up a quick sample below where I have a table with fields:
First_Name, Last_Name & Full_Name
First_Name & Last_Name are using our standard generators
Then for Full_Name I wrote a simple script that loops through each record and creates a concatenation of records.
When a field change occurs the python script updates the record to match
This could be modified for your own requirements to add in extra fields or manipulate them further
Hope this assists with building some finer data handling intelligence into your Data Generator usage.