Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding linking tables without relationship diagrams?? 1

Status
Not open for further replies.

fguihen

Programmer
Apr 16, 2004
4
IE
theres a fairly big sql database in a server at my work. i have to link it to another sql server database on a different server. before i do this i want to find out what tables are linked in each DB, but theres no documentation and no diagrams. is there any query that will tell me what tables are linked to eachother , or a program .
 
Go to Enterprise Manager, open database, go to Diagrams. Click "New Diagram", add all user tables, next, finish and please wait.

After you are done, save diagram - all info will be stored in table "dtproperties".
 
I don't fully understand the question. If I knew WHY you needed to know what tables "are linked in each database" that would help.
-Karl
 
i have no idea what any of the columns in the DB do so i want to see what tables are related so i can start figuring out what data is for what
 
Creating a "relationship" between tables doesn't have anything to do with a link between database servers. At least none that I'm aware of. Those who use the link are going to have to know about the tables on both servers in order to do specific tasks, of course. Is that you?
-Karl
 
yiou didnt understand the problem.there are 2 DB's. i have never seen them before . when i try to figure out what tables are related to what( not between DB's) i dont know.i just want to find out the relationship between tables in one DB, then the relationship between tables only contained in the 2nd db. then i can start finding similarities, and then i can do what i have to with tht two tables.hope that makes it a bit clearer. thanks all
 
Another option is to generating the diagram is to generate the SQL scripts for all the tables (make sure to check the option to "Script Primary Keys, Foreign Keys ..."). Along with the table definitions, it will also generate the table "relationships"; that is, at least this ones that enforce referential integrity.

Do you have a sense of how good (anal) the developer of the data was? If they were sloppy, they may not have explicity defined the relationships and you may have to look for them manually.

Good Luck
 
vongrunt hass the simplest method of findout the existing relationships. However, I agree with Vogon, the relationships don't necessarily have to be specified with primary and foreign keys. You may need to look at the queries and stored procedures to see what fields they join on to find the real relationships.
 
VogonPoet ,
That's exactly what I was looking for !!!!

Stars are in the air

DougP, MCP, A+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top