How to set referential integrity rules in Microsoft SQL Server Management Studio 2008
I am new with Management Studio. I built relation between these two tables, but how to set inte开发者_运维百科grity rules on them, like many-to-one, or many-to-many?
tables http://www.imageupload.org/thumb/thumb_98396.png
http://www.imageupload.org/?d=5862C4631 here is download link for pictre.
When you create the link between columns, the relationship dialog that appears will allow you to specify which table is the Primary key table and which is the foreign key table. The primary key table is the "One" the foreign key table is the "Many".
In the diagram you provided, the Key icon shows which side is the "One" while the infinity icon shows which side is the "Many"
I don't think you can create a many-to-many relationship directly between two tables. In order to do that you have to create an intermediate table that sits between the two related tables.
精彩评论