Trying to verify understanding of foreign keys SQL Server

Posted by msarchet on Stack Overflow See other posts from Stack Overflow or by msarchet
Published on 2010-04-17T22:09:06Z Indexed on 2010/04/18 9:43 UTC
Read the original article Hit count: 370

Filed under:
|

So I'm working on just a learning project to expose myself to doing some things I do not get to do at work. I'm just making a simple bug and case tracking app (I know there are a million this is just to work with some tools I don't get to). So I was designing my database and realized I've never actually used Foreign Keys before in any of my projects, I've used them before but never actually setting up a column as a FK. So I've designed my database as follows, which I think is close to correct (at least for the initial layout). Database Image

However When I try to add the FK's to the linking Tables I get an error saying, "The tables present in the relationship must have the same number of columns". I'm doing this by in SQLSMS by going to the Keys 'folder' and adding a FK. Is there something that I am doing wrong here, I don't understand why the tables would have to have the same number of columns for me to add a FK relationship between the tables?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2008