Comments
Sort by recent activity
You can do this with a little leg work. If a foreign key constraint has been defined on the column, SDG does not allow selection of a different generator. In this case, you would need to drop the constraint before loading the schema into SDG. You could create an "after" script to recreate the constraint within SDG.
Once the constraint is removed (or if it wasn't there in the first place) then you are free to use the "SQL Statement" generator to connect to any database and get any values you want for population. / comments
You can do this with a little leg work. If a foreign key constraint has been defined on the column, SDG does not allow selection of a different generator. In this case, you would need to drop the c...
Although I don't know exactly what your situation is, some of redgate's generators are generic enough to allow you to do about anything.
For example (if the list is small) you could use the Regular Expression generator like so:
(FkIWant1|FkIWant2|FkIWant3|FkIWant4|FkIWant5|FkIWant6|FkIWant7|FkIWant8|FkIWant9|FkIWant10)
Or you could use the SQL Statement generator to connect to the DB and run a statement like so:
SELECT Fk
FROM Table
WHERE Data = 'Only the Fk''s I want' / comments
Although I don't know exactly what your situation is, some of redgate's generators are generic enough to allow you to do about anything.
For example (if the list is small) you could use the Regular...
There is no guarantee that items in a weighted list will be unique. In your situation (all items weighted the same) they all have an equal chance of being generated for each row. Meaning that even if a value has been used it still has a chance to show up again.
Weighted lists do not have the "Set Unique" option.
I would suggest using the Regular Expression generator as follows:
Check the "Set Unique" box
Uncheck the "Allow null values" box
In the text area for the regular expression type your values in parenthesis separated with pipes like so:
(Value1|Value2|Value3|Value4|Value5|Value6|Value7|Value8|Value9|Value10)
That should do the trick. / comments
There is no guarantee that items in a weighted list will be unique. In your situation (all items weighted the same) they all have an equal chance of being generated for each row. Meaning that even ...
Sometimes the solution is so easy we don't even think about it. No custom Iron Ruby generator needed at all. SDG has a section for running SQL scripts before or after generation, so this is what I did:
Set ForeignKey1 to allow nulls 50% of the time
Set ForeignKey2 to NOT allow nulls
Create a script to run AFTER generation that fixes it:
UPDATE Table1
SET ForeignKey2 = NULL
WHERE ForeignKey1 IS NOT NULL
That's it! / comments
Sometimes the solution is so easy we don't even think about it. No custom Iron Ruby generator needed at all. SDG has a section for running SQL scripts before or after generation, so this is what I ...