Generating data based on another table
lfarrington
Posts: 4
I am new to Sql Data Generator. I have two tables which are related via a foreign key. For each row in the parent table, I want to create 12 rows in the child table (one for each month). So, my child table has a date field in it and I want 12 rows (one row for the first day of each month in the year.) What is the best generator to use to do this. I cannot figure out how without getting duplicates. Can you give me some tips here? Thanks in advance.
Comments
This is something that would require some very custom logic, using the Python generator. You'd need to write a function in Python that computes a date representing the first day of every month in the year. SQL Data Generator can mainly generate "random" data and doesn't have ways to generate data this specifically except through a custom script.
I re-read this request several times, but I am still unclear about how the foreign-key relationship comes into this so I don't know if you need a cross-column generator. It doesn't sound like you need to base this data on data from another column.