I just added the PackageItems table to the existing SQL Server 2008 R2 database. I work in SQL Server Management Studio. After creating a new table, I created a relationship between this table and another Package table. The FK_PackageItems_Package relationship makes the primary key of the Package table (PackageID) the foreign key in my new PackageItems table. Both tables have a common column named PackageID (int, not null).
My question is the following. The primary and foreign keys for each other table in the database are clearly indicated in the "Object Explorer" panel in SSMS. I see gold or gray keys next to the columns, and I also see PK or FK in parentheses next. But my newly created relationship (FK_PackageItems_Package) is not represented in this way. Did I do something wrong?
Note. To create FK relationships, I went into the design view for PackageItems, clicked the Relationships icon, clicked Add, clicked the ... button next to Table and Column Specification. Then in the window that appeared, I selected Package as my main key table and PackageID. And I chose PackageItems and PackageID for my table and foreign key column.
Hope this is not a too stupid question. Thanks in advance for watching.
source
share