Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
learntsql
524 Posts |
Posted - 2009-12-22 : 04:06:14
|
Hi..How to List out all Parent and Child tables of the database.The problem is some of the tables are mapped with foriegn key some are not. then how to find the parent and child tables. |
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2009-12-22 : 04:41:03
|
well if you haven't set up an implicit relationship then you are out of luck.Do you have any kind of column / table naming convention?For instance if your tables are likeemployeeand columns that link to this logically have an [employeeId] column.then you could probably write something using the view information_schema.columnsCharlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
learntsql
524 Posts |
Posted - 2009-12-22 : 04:53:47
|
Thank you Charlie.I will look in that way.If foreign key is defined how to find out the related tablesasParentTable-->ChildTables |
 |
|
|
|
|