sql - two columns referencing a single column in another table -


A similar question has been asked here but the syntax is not shown in the answer. I would like to know how this can be accomplished in SQL Server. Returns the following syntax error

  Optional table itemExcludeExclude FK_ItemIssue_Person Foreign key (person, consultant) Reference person (person);  

Error: The number of referenced columns in foreign key differs from the number of referenced columns, the table 'item ISM'.

  - Create a table of table items (MadISEID Ident Identity (1,1) Faucet, Personal Int, Advisor IIAD,); Make a table person (person rectangle number zero, name navigator (500),)  

;

You need to define two foreign keys, one for each column:

  Optional table itemEasy insert FK_ItemIssue_Person foreign key reference (person) reference person (person); Optional Table ItemIssue Add Insert FK_ItemAdvisor_Person Foreign Key (Advisor) Reference Person (PersonID);  

Comments