Home Forums SQL Server 2005 SQL Server Newbies How to design 1:n relationships in Sql Server Management Studio? RE: How to design 1:n relationships in Sql Server Management Studio?

  • Have a look at what it generates.

    You will have two tables.

    One will have a foreign key that references the other

    create table manager

    (

    manager_id int

    )

    create table player

    (

    player_id int ,

    manager_id int ,

    foreign key (manager_id) references manager (manager_id)

    )

    (something like that).

    So yes - it does matter which way round the tables are as you want the foreign key to on player not manger.

    The 1-n part is enforced by a unique index on manager.manager_id and player.player_id

    Try doing this using scripts - you'll proably find it easier to understand what is going on.


    Cursors never.
    DTS - only when needed and never to control.