At least, that's how it looks to me. I'm using Sql Server CE 4.0 and Visual Studio 2010. This is the first time I've used Sql Server CE.
For example, I have two tables. One is called Templates:
TemplateID (int, primary key, identity)
TemplateName (nvarchar)
The other is called Products:
ProductID (int, primary key, identity)
TemplateID (int, foreign key relationship with Templates)
ProductName (nvarchar)
After creating these tables, I attempted to set up a foreign key relationship between the tables on the TemplateID field in Products and the TemplateID field in Templates.
After setting up the relationship, when I look at the Products table in the Server Explorer, I see that TemplateID has been flagged as a primary key in Products. This is NOT supposed to be a primary key in that table!
Is this simply some oddity of presentation for CE tables -- meaning the foreign key is a primary key in some other table? It doesn't seem so, because clicking on the TemplateID column in the Products table, and expanding the Identity tag in the Properties window, shows that the "Table" is Products, not Templates.
If anyone could shed light on this strangeness I would really appreciate it.
Some testing confirmed that the foreign keys are NOT included as part of the primary key, the display in Visual Studio notwithstanding.
So, apparently it's just a clumsy, confusing way of displaying the fields of the tables in Visual Studio Server Explorer.
Yeesh. I miss Management Studio already ...