Red Gate forums :: View topic - Foreign keys from another database?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

Foreign keys from another database?

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Michael.Kriegner



Joined: 29 Aug 2006
Posts: 7

PostPosted: Wed Jun 17, 2009 12:44 pm    Post subject: Foreign keys from another database? Reply with quote

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
Back to top
View user's profile Send private message
Linda Hawksworth



Joined: 25 Jun 2007
Posts: 192

PostPosted: Fri Jun 19, 2009 11:25 am    Post subject: Reply with quote

I have sent you a PM asking for further information on your exact requirements.
Back to top
View user's profile Send private message
Linda Hawksworth



Joined: 25 Jun 2007
Posts: 192

PostPosted: Tue Jun 23, 2009 11:52 am    Post subject: Reply with quote

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/article.aspx?article=697)
Back to top
View user's profile Send private message
madhavi79



Joined: 06 Oct 2009
Posts: 2

PostPosted: Tue Oct 06, 2009 5:54 pm    Post subject: Select foreign key values from tables in another database Reply with quote

I have the same requirement to Select foreign key values from tables in another database? Is there a way?
Back to top
View user's profile Send private message
dslinn@gms.ca



Joined: 01 Apr 2009
Posts: 7

PostPosted: Thu Nov 26, 2009 11:53 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
almasmith



Joined: 26 Jan 2010
Posts: 7

PostPosted: Wed Feb 03, 2010 7:45 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group