SQL Server Management Studio – adding foreign key confusing?

  • Click the expand symbol next to the table.
  • Right click on the “Keys” folder and select “New Foreign Key.”
  • (Alternatively, you can click the Relationships button on the toolstrip when you have the table open)
  • Click the “…” button on the “Tables and Columns Specifications” row to open the editor.
  • The drop down on the left will be the table you’re adding from, and the static text field will list the table you’re adding to.
  • Use the dropdowns to specify your constraints, and be sure both sides have the same number of columns.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)