Foreign keys from another database?

The simplest way to populate your database with test data.

Moderators: David Atkinson, Anu Deshpande, Lionel

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
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: http://www.simple-talk.com/content/arti ... 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?
madhavi79
 
Posts: 2
Joined: Tue Oct 06, 2009 2:33 pm

Postby dslinn@gms.ca » 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.
dslinn@gms.ca
 
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.
almasmith
 
Posts: 7
Joined: Tue Jan 26, 2010 10:55 pm


Return to SQL Data Generator 1

Who is online

Users browsing this forum: No registered users and 1 guest