Imagine I have two tables: Manager and Player. This is for a football team, where several players can play for one manager only and a manager manages several (11) players.
When designing the relationship in Sql Server, at the time the popup window comes up with the properties for the relationship, does it matter which side the tables are?
So in other words is there a difference in connecting the key from Player to Manager or from Manager to Player?
And how do I specify the relationship as 1:n or is it automatically decided as 1:n or 1:1? In Access you can choose between 1:1 and 1:n due to the connector style (crows feet and all that), but not in Sql Server.
It matters, but it's the structure that makes the difference. If you have a Manager, let's say the PK is the ManagerID, and you have a Player, who's PK is PlayerID (maybe not the best choices, I'm not arguing that, they're easy for references). In your tables, if neither has a field that represents the PK of the other, then you can't establish a relationship. But if the Player has a ManagerID field, then you can't ever have 1:n from the Player to the Manager. Think about it. Only a single Manager can possibly be associated with the player in that situation. But look at it from the other point of view. A manager can have any number of players with his ID in the associated field, making it 1:n.
To make it go the other way for the player to the manager, the manager would have to have a field that associates to the player, but, that's going to make for very small football teams.
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore RooseveltThe Scary DBA
Author of: SQL Server Query Performance Tuning
and SQL Server Execution Plans
Product Evangelist for Red Gate Software