View Single Post
TheMentat TheMentat is offline
Registered
 
TheMentat's Avatar
 
Join Date: Dec 2004
Location: Ocean Park, BC
Posts: 2,451
Garage
Quote:
Originally Posted by legion View Post
DBA wanna-be here.

I'd think you'd have to know the data model to automate that kind of thing. If it were even possible to do what you are asking, all of the keys would have to be named the same in each table they are used. One deviation could throw everything off.

I don't know of any tool that you can feed a database and it will generate a data model. We use the Rational suite around here to do the opposite (use the data model to generate the database).

I would second this... the code I provided will hopefully get you started on establishing relationships between the tables based on the column names only.


I should also say, that I'm not in any way a DB professional either... so my advice is probably only worth what it cost you!
__________________
Silver '88 RoW Carrera
Grey '06 A4 Avant
Old 03-28-2008, 12:12 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #11 (permalink)