Foreign keys from another database?

The simplest way to populate your database with test data.

Foreign keys from another database?

Postby Michael.Kriegner » Wed Jun 17, 2009 12:44 pm

Is it possible to select foreign key values from tables in another database? Something to customize with a select? Because we have many datatables shifted into a main database.

Thanks for help,

Michael Kriegner
Posts: 7
Joined: Tue Aug 29, 2006 6:47 pm

Postby Linda Hawksworth » Fri Jun 19, 2009 11:25 am

I have sent you a PM asking for further information on your exact requirements.
Linda Hawksworth
Posts: 192
Joined: Mon Jun 25, 2007 11:32 am

Postby Linda Hawksworth » Tue Jun 23, 2009 11:52 am

SQL Data Generator is quite a powerful tool out of the box and even more so with the embedded IronRuby generator.

(see: ... rticle=697)
Linda Hawksworth
Posts: 192
Joined: Mon Jun 25, 2007 11:32 am

Select foreign key values from tables in another database

Postby madhavi79 » Tue Oct 06, 2009 5:54 pm

I have the same requirement to Select foreign key values from tables in another database? Is there a way?
Posts: 2
Joined: Tue Oct 06, 2009 2:33 pm

Postby » Thu Nov 26, 2009 11:53 pm

I would like to second the original posters request about making this tool "multi-database" aware. Our primary business system is made up of 10 databases total, one stores client info, 3 store financial records from three different entities that operate under the umbrella of our company and another stores standard reference information. I attempted to generate some test data. We use triggers to enforce foreign key relationships across database boundaries (we use declarative foreign key constraints when the tables are both in the same database). I was unable to use this tool because of this aspect of our architecture.
Posts: 7
Joined: Wed Apr 01, 2009 12:28 am

Postby almasmith » Wed Feb 03, 2010 7:45 pm

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.
Posts: 7
Joined: Tue Jan 26, 2010 10:55 pm

Return to SQL Data Generator Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests