Defining Keys through Management Studio

  • Hi,

    I am using SQL Server 2005.

    I have created the tables for my Database through the Management Studio front end tool.

    I can apply a primary key to the tables easily enough. What I am having trouble with is assigning multiple columns as primary keys and also how to define foreign keys between tables.

    Does anyone have suggesstions how I can achieve this through management studio?

    Thanks In Advance

    Macca

  • Hello Macca,

    In the Management Studio right-click on your table, click Modify, right-click on the column you need.

    Select Set Primery Key for setting Primary Key. Set it on one column. Right-click on this column again. Select Indexes/Keys. You will see your primary key on the left. Click on the Columns dropdown on the right and add columns. You can also create all types of keys and indexes in this tool.

    Use Relationships from right-click context menu for the table column to set foreign keys.

     

    Regards,Yelena Varsha

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply