aahmed19
asked on
Extract Relationship from MS SQL Server
Hi Exprets,
I am making an application using MS SQL Server and I need to know that what kind of relationships are existing between table e.g. 1-1 or 1-M. I can get the constraint's, coulumn, table, types information from INFORMATION_SCHEMA at this point but I still need to find the relationship types between tables.
I am using C# and ADO.NET and the version of Database Server right now is MS SQL Server 2000 but Finally I will be utilizing MS SQL Server 2005.
Any idea, suggestion, snippet?
Thankx
I am making an application using MS SQL Server and I need to know that what kind of relationships are existing between table e.g. 1-1 or 1-M. I can get the constraint's, coulumn, table, types information from INFORMATION_SCHEMA at this point but I still need to find the relationship types between tables.
I am using C# and ADO.NET and the version of Database Server right now is MS SQL Server 2000 but Finally I will be utilizing MS SQL Server 2005.
Any idea, suggestion, snippet?
Thankx
If you have Enterprise Manager, you may create Database Diagrams to show the relationship between tables. Check the content about Database Diagrams in MS SQL-Server Book Online.
--"The endpoints of the line indicate whether the relationship is one-to-one or one-to-many. If a relationship has a key at one endpoint and a figure-eight at the other, it is a one-to-many relationship. If a relationship has a key at each endpoint, it is a one-to-one relationship."
--"The endpoints of the line indicate whether the relationship is one-to-one or one-to-many. If a relationship has a key at one endpoint and a figure-eight at the other, it is a one-to-many relationship. If a relationship has a key at each endpoint, it is a one-to-one relationship."
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please see these links
Relation Types - One to Many
http://courses.mbl.edu/Medical_Informatics/2000.2/Remsen/Databases/relation_types.html
Relation Types - Many to Many
http://courses.mbl.edu/Medical_Informatics/2000.2/Remsen/Databases/Many2Many.html
Which are main database relation types
http://www.faqts.com/knowledge_base/view.phtml/aid/31376/fid/132\
Relation Types - One to Many
http://courses.mbl.edu/Medical_Informatics/2000.2/Remsen/Databases/relation_types.html
Relation Types - Many to Many
http://courses.mbl.edu/Medical_Informatics/2000.2/Remsen/Databases/Many2Many.html
Which are main database relation types
http://www.faqts.com/knowledge_base/view.phtml/aid/31376/fid/132\
1-1 and 1-M can show precisely the same constraints.
AW